wp_body_open()
Fire the wp_body_open action.
Description
- See ‘wp_body_open’.
Source
File: wp-includes/general-template.php
function wp_body_open() { /** * Triggered after the opening <body> tag. * * @since 5.2.0 */ do_action( 'wp_body_open' ); }
Changelog
Version | Description |
---|---|
5.2.0 | Introduced. |
WordPress theme developers should use `
wp_head()
`, `wp_body_open()
` and `wp_footer()
` functions in their themes (read this for more information).The new WordPress theme structure:
Expand full source codeCollapse full source code
Don’t forget backward compatibility.
Custom Theme Hooks
Many themes use their own custom actions at the beginning of body tag. They should consider migrating to the core wp_body_open action.
For backwards compatibility, when injecting custom code, theme developers can use conditional logic to hook to the right action