WordPress plugin for converting pages and post types to modals
- converting pages to modal
- converting default post type to modal
- converting custom post types to modal
- registering custom modal templates
- custom js events
- Converting Pages to modals
Edit Page -> Is Modal (Yes)
Choose archive page (page that opens in background of modal)
- Converting Post Types to modal
BF Modal Options -> Choose post type to convert
- Registering modal templates
Use bfml_register_modal_templates( array $templates ) {}
$templates = array('Default Modal Template', 'Test Modal Template');
if ( function_exists( 'bfml_register_modal_templates' ) ) {
bfml_register_modal_templates( array( 'Default Template', 'Test Modal Template' ) );
}
Name of templates are created with WordPress function sanitize_title_with_dashes()
Example: Default Modal Template -> default-modal-template
- Opening popups
- add class js-bfml-modal-trigger -> it triggers endpoint to populate modal
- data-post-data-id (required) -> id of post/page to pull content from
- data-return-url(optional) -> returning URL, by default returns to current URL modal is opened from
<a href="<?php echo get_permalink( $post_id ); ?>" class="js-bfml-modal-trigger" data-post-data-id="12">
This is a test post type Link
</a>
- Custom JS Events
- bfml:init-modal
- bfml:open-modal
- bfml:close-modal
- bfml:populate-modal
- bfml:after-populate-modal
- MIT license
- Copyright 2021 © Bornfight.