Bundled Theme: add a `wp_body_open` shim for older WordPress versions.

WordPress 5.2 adds the `wp_body_open()` function, and the default themes make use of it. This patch adds a shim for `wp_body_open` to bundled themes so this function will also work in older versions of WordPress.

Props lgedeon, johnbillion, timph, ramiy, pento.
Fixes #46679.


Built from https://develop.svn.wordpress.org/trunk@45256


git-svn-id: http://core.svn.wordpress.org/trunk@45065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2019-04-23 13:04:56 +00:00
parent 27acbc2ef4
commit 369208ac1e
1 changed files with 18 additions and 1 deletions

View File

@ -667,7 +667,6 @@ function twentytwelve_customize_preview_js() {
}
add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
/**
* Modifies tag cloud widget arguments to display all tags in the same font size
* and use list format for better accessibility.
@ -686,3 +685,21 @@ function twentytwelve_widget_tag_cloud_args( $args ) {
return $args;
}
add_filter( 'widget_tag_cloud_args', 'twentytwelve_widget_tag_cloud_args' );
if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
*
* Added for backwards compatibility to support pre 5.2.0 WordPress versions.
*
* @since Twenty Twelve 3.0
*/
function wp_body_open() {
/**
* Triggered after the opening <body> tag.
*
* @since Twenty Twelve 3.0
*/
do_action( 'wp_body_open' );
}
endif;