Make WordPress Core


Ignore:
Timestamp:
04/23/2019 01:03:14 PM (6 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/twentyfourteen/inc/template-tags.php

    r44574 r45256  
    233233    add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' );
    234234endif;
     235
     236if ( ! function_exists( 'wp_body_open' ) ) :
     237    /**
     238     * Fire the wp_body_open action.
     239     *
     240     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     241     *
     242     * @since Twenty Fourteen 2.7
     243     */
     244    function wp_body_open() {
     245        /**
     246         * Triggered after the opening <body> tag.
     247         *
     248         * @since Twenty Fourteen 2.7
     249         */
     250        do_action( 'wp_body_open' );
     251    }
     252endif;
Note: See TracChangeset for help on using the changeset viewer.