Make WordPress Core


Ignore:
Timestamp:
06/16/2023 01:03:00 PM (3 years ago)
Author:
swissspidy
Message:

Bundled Themes: Remove load_theme_textdomain() calls from default themes.

Since WordPress 4.6 introduced just-in-time translation loading, themes and plugins no longer need to manually call load_theme_textdomain/load_plugin_textdomain, unless they are on a version prior to 4.6.

This change removes the load_theme_textdomain() call from Twenty Seventeen and up, since these themes all require at least WordPress 4.7.
On older default themes, load_theme_textdomain() is called conditionally depending on the WordPress version.

Props piyushtekwani.
Fixes #58318.

File:
1 edited

Legend:

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

    r55861 r55929  
    5858                 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen
    5959                 * If you're building a theme based on twentyfifteen, use a find and replace
    60                  * to change 'twentyfifteen' to the name of your theme in all the template files
    61                  */
    62                 load_theme_textdomain( 'twentyfifteen' );
     60                 * to change 'twentyfifteen' to the name of your theme in all the template files.
     61                 *
     62                 * Manual loading of text domain is not required after the introduction of
     63                 * just in time translation loading in WordPress version 4.6.
     64                 *
     65                 * @ticket 58318
     66                 */
     67
     68                if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     69                        load_theme_textdomain( 'twentyfifteen' );
     70                }
    6371
    6472                // Add default posts and comments RSS feed links to head.
Note: See TracChangeset for help on using the changeset viewer.