Move modals to wp_footer hook
This may or may not improve performance due to the sibling selectors used.
This commit is contained in:
parent
12466a6872
commit
2748733e7e
@ -138,7 +138,6 @@ Fires after `wp_body_open()` in the `<body>` right before the inline storage ele
|
||||
* $header_args (array) – Arguments passed to the header.php partial.
|
||||
|
||||
**Hooked actions:**
|
||||
* `fictioneer_output_modals()` – HTML for the modals. Priority 10.
|
||||
* `fictioneer_output_mobile_menu()` – HTML for the mobile menu. Priority 20.
|
||||
|
||||
---
|
||||
|
@ -248,6 +248,7 @@ Fictioneer customizes WordPress by using as many standard action hooks as possib
|
||||
| `wp_default_scripts` | `fictioneer_remove_jquery_migrate`
|
||||
| `wp_enqueue_scripts` | `fictioneer_add_custom_scripts`, `fictioneer_customizer_queue`, `fictioneer_style_queue`
|
||||
| `wp_head` | `fictioneer_output_head_seo`, `fictioneer_output_rss`, `fictioneer_output_schemas`
|
||||
| `wp_footer` | `fictioneer_output_modals`
|
||||
|
||||
| ACF HOOK | FICTIONEER ACTIONS
|
||||
| ---: | :--- |
|
||||
|
@ -52,7 +52,7 @@
|
||||
echo '<div id="fictioneer-lightbox" class="lightbox"><button type="button" class="lightbox__close" aria-label="' . esc_attr__( 'Close lightbox', 'fictioneer' ) . '">' . fictioneer_get_icon( 'fa-xmark' ) . '</button><i class="fa-solid fa-spinner fa-spin loader" style="--fa-animation-duration: .8s;"></i><div class="lightbox__content target"></div></div>';
|
||||
}
|
||||
|
||||
// WordPress footer hook
|
||||
// WordPress footer hook (includes modals)
|
||||
wp_footer();
|
||||
?>
|
||||
|
||||
|
@ -109,7 +109,7 @@
|
||||
'header_args' => $args
|
||||
);
|
||||
|
||||
// Includes mobile menu and modals
|
||||
// Includes mobile menu
|
||||
do_action( 'fictioneer_body', $action_args );
|
||||
|
||||
// Inline storage tuples
|
||||
|
@ -111,7 +111,7 @@ if ( ! function_exists( 'fictioneer_output_modals' ) ) {
|
||||
do_action( 'fictioneer_modals' );
|
||||
}
|
||||
}
|
||||
add_action( 'fictioneer_body', 'fictioneer_output_modals', 10 );
|
||||
add_action( 'wp_footer', 'fictioneer_output_modals' );
|
||||
|
||||
// =============================================================================
|
||||
// OUTPUT NAVIGATION BAR
|
||||
|
Loading…
x
Reference in New Issue
Block a user