WordPress.org

Make WordPress Core

Changeset 45256


Ignore:
Timestamp:
04/23/2019 01:03:14 PM (3 months 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.

Location:
trunk/src/wp-content/themes
Files:
9 edited

Legend:

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

    r45218 r45256  
    884884}
    885885add_filter( 'widget_tag_cloud_args', 'twentyeleven_widget_tag_cloud_args' );
     886
     887if ( ! function_exists( 'wp_body_open' ) ) :
     888    /**
     889     * Fire the wp_body_open action.
     890     *
     891     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     892     *
     893     * @since Twenty Eleven 3.3
     894     */
     895    function wp_body_open() {
     896        /**
     897         * Triggered after the opening <body> tag.
     898         *
     899         * @since Twenty Eleven 3.3
     900         */
     901        do_action( 'wp_body_open' );
     902    }
     903endif;
  • trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php

    r44574 r45256  
    268268    }
    269269endif;
     270
     271if ( ! function_exists( 'wp_body_open' ) ) :
     272    /**
     273     * Fire the wp_body_open action.
     274     *
     275     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     276     *
     277     * @since Twenty Fifteen 2.5
     278     */
     279    function wp_body_open() {
     280        /**
     281         * Triggered after the opening <body> tag.
     282         *
     283         * @since Twenty Fifteen 2.5
     284         */
     285        do_action( 'wp_body_open' );
     286    }
     287endif;
  • 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;
  • trunk/src/wp-content/themes/twentynineteen/inc/template-tags.php

    r44305 r45256  
    239239    }
    240240endif;
     241
     242if ( ! function_exists( 'wp_body_open' ) ) :
     243    /**
     244     * Fire the wp_body_open action.
     245     *
     246     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     247     *
     248     * @since Twenty Nineteen 1.4
     249     */
     250    function wp_body_open() {
     251        /**
     252         * Triggered after the opening <body> tag.
     253         *
     254         * @since Twenty Nineteen 1.4
     255         */
     256        do_action( 'wp_body_open' );
     257    }
     258endif;
  • trunk/src/wp-content/themes/twentyseventeen/inc/template-tags.php

    r42343 r45256  
    199199add_action( 'edit_category', 'twentyseventeen_category_transient_flusher' );
    200200add_action( 'save_post', 'twentyseventeen_category_transient_flusher' );
     201
     202if ( ! function_exists( 'wp_body_open' ) ) :
     203    /**
     204     * Fire the wp_body_open action.
     205     *
     206     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     207     *
     208     * @since Twenty Seventeen 2.2
     209     */
     210    function wp_body_open() {
     211        /**
     212         * Triggered after the opening <body> tag.
     213         *
     214         * @since Twenty Seventeen 2.2
     215         */
     216        do_action( 'wp_body_open' );
     217    }
     218endif;
  • trunk/src/wp-content/themes/twentysixteen/inc/template-tags.php

    r44574 r45256  
    265265    }
    266266endif;
     267
     268if ( ! function_exists( 'wp_body_open' ) ) :
     269    /**
     270     * Fire the wp_body_open action.
     271     *
     272     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     273     *
     274     * @since Twenty Sixteen 2.0
     275     */
     276    function wp_body_open() {
     277        /**
     278         * Triggered after the opening <body> tag.
     279         *
     280         * @since Twenty Sixteen 2.0
     281         */
     282        do_action( 'wp_body_open' );
     283    }
     284endif;
  • 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;
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r45218 r45256  
    779779}
    780780add_filter( 'widget_tag_cloud_args', 'twentythirteen_widget_tag_cloud_args' );
     781
     782if ( ! function_exists( 'wp_body_open' ) ) :
     783    /**
     784     * Fire the wp_body_open action.
     785     *
     786     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     787     *
     788     * @since Twenty Thirteen 2.8
     789     */
     790    function wp_body_open() {
     791        /**
     792         * Triggered after the opening <body> tag.
     793         *
     794         * @since Twenty Thirteen 2.8
     795         */
     796        do_action( 'wp_body_open' );
     797    }
     798endif;
  • trunk/src/wp-content/themes/twentytwelve/functions.php

    r45218 r45256  
    668668add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
    669669
    670 
    671670/**
    672671 * Modifies tag cloud widget arguments to display all tags in the same font size
     
    687686}
    688687add_filter( 'widget_tag_cloud_args', 'twentytwelve_widget_tag_cloud_args' );
     688
     689if ( ! function_exists( 'wp_body_open' ) ) :
     690    /**
     691     * Fire the wp_body_open action.
     692     *
     693     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     694     *
     695     * @since Twenty Twelve 3.0
     696     */
     697    function wp_body_open() {
     698        /**
     699         * Triggered after the opening <body> tag.
     700         *
     701         * @since Twenty Twelve 3.0
     702         */
     703        do_action( 'wp_body_open' );
     704    }
     705endif;
Note: See TracChangeset for help on using the changeset viewer.