Make WordPress Core


Ignore:
Timestamp:
04/23/2019 01:03:14 PM (8 years ago)
Author:
adamsilverstein
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyten/functions.php

    r45218 r45256  
    719719add_action( 'enqueue_block_editor_assets', 'twentyten_block_editor_styles' );
    720720
    721 
     721if ( ! function_exists( 'wp_body_open' ) ) :
     722        /**
     723         * Fire the wp_body_open action.
     724         *
     725         * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     726         *
     727         * @since Twenty Ten 2.9
     728         */
     729        function wp_body_open() {
     730                /**
     731                 * Triggered after the opening <body> tag.
     732                 *
     733                 * @since Twenty Ten 2.9
     734                 */
     735                do_action( 'wp_body_open' );
     736        }
     737endif;
Note: See TracChangeset for help on using the changeset viewer.