Make WordPress Core

Ticket #58318: load-theme-textdomain.diff

File load-theme-textdomain.diff, 10.2 KB (added by piyushtekwani, 3 years ago)
  • src/wp-content/themes/twentyeleven/functions.php

    diff --git src/wp-content/themes/twentyeleven/functions.php src/wp-content/themes/twentyeleven/functions.php
    index 7dc3bf52ef..08dc07255c 100644
    if ( ! function_exists( 'twentyeleven_setup' ) ) : 
    7979                 * If you're building a theme based on Twenty Eleven, use
    8080                 * a find and replace to change 'twentyeleven' to the name
    8181                 * of your theme in all the template files.
     82                 * Manual loading of text domain is not required after the introduction of
     83                 * just in time loading for translations in WordPress version 4.6.
    8284                 */
    83                 load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' );
     85                if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     86                        load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' );
     87                }
    8488
    8589                // This theme styles the visual editor with editor-style.css to match the theme style.
    8690                add_editor_style();
  • src/wp-content/themes/twentyfifteen/functions.php

    diff --git src/wp-content/themes/twentyfifteen/functions.php src/wp-content/themes/twentyfifteen/functions.php
    index 0528a01be9..50b4ccff4d 100644
    if ( ! function_exists( 'twentyfifteen_setup' ) ) : 
    5757                 * Make theme available for translation.
    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
     60                 * to change 'twentyfifteen' to the name of your theme in all the template files.
     61                 * Manual loading of text domain is not required after the introduction of
     62                 * just in time loading for translations in WordPress version 4.6.
    6163                 */
    62                 load_theme_textdomain( 'twentyfifteen' );
     64
     65                if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     66                        load_theme_textdomain( 'twentyfifteen' );
     67                }
    6368
    6469                // Add default posts and comments RSS feed links to head.
    6570                add_theme_support( 'automatic-feed-links' );
  • src/wp-content/themes/twentyfourteen/functions.php

    diff --git src/wp-content/themes/twentyfourteen/functions.php src/wp-content/themes/twentyfourteen/functions.php
    index 22305e5b97..b044c991f6 100644
    if ( ! function_exists( 'twentyfourteen_setup' ) ) : 
    6464                 * If you're building a theme based on Twenty Fourteen, use a find and
    6565                 * replace to change 'twentyfourteen' to the name of your theme in all
    6666                 * template files.
     67                 * Manual loading of text domain is not required after the introduction of
     68                 * just in time loading for translations in WordPress version 4.6.
    6769                 */
    68                 load_theme_textdomain( 'twentyfourteen' );
     70                if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     71                        load_theme_textdomain( 'twentyfourteen' );
     72                }
    6973
    7074                /*
    7175                 * This theme styles the visual editor to resemble the theme style.
  • src/wp-content/themes/twentynineteen/functions.php

    diff --git src/wp-content/themes/twentynineteen/functions.php src/wp-content/themes/twentynineteen/functions.php
    index 98c4108577..b3877a3f77 100644
    if ( ! function_exists( 'twentynineteen_setup' ) ) : 
    2626         * as indicating support for post thumbnails.
    2727         */
    2828        function twentynineteen_setup() {
    29                 /*
    30                  * Make theme available for translation.
    31                  * Translations can be filed in the /languages/ directory.
    32                  * If you're building a theme based on Twenty Nineteen, use a find and replace
    33                  * to change 'twentynineteen' to the name of your theme in all the template files.
    34                  */
    35                 load_theme_textdomain( 'twentynineteen', get_template_directory() . '/languages' );
    3629
    3730                // Add default posts and comments RSS feed links to head.
    3831                add_theme_support( 'automatic-feed-links' );
  • src/wp-content/themes/twentyseventeen/functions.php

    diff --git src/wp-content/themes/twentyseventeen/functions.php src/wp-content/themes/twentyseventeen/functions.php
    index 8ecc87b858..6b6b203a2d 100644
    if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '<' ) ) { 
    2525 * as indicating support for post thumbnails.
    2626 */
    2727function twentyseventeen_setup() {
    28         /*
    29          * Make theme available for translation.
    30          * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyseventeen
    31          * If you're building a theme based on Twenty Seventeen, use a find and replace
    32          * to change 'twentyseventeen' to the name of your theme in all the template files.
    33          */
    34         load_theme_textdomain( 'twentyseventeen' );
    3528
    3629        // Add default posts and comments RSS feed links to head.
    3730        add_theme_support( 'automatic-feed-links' );
  • src/wp-content/themes/twentysixteen/functions.php

    diff --git src/wp-content/themes/twentysixteen/functions.php src/wp-content/themes/twentysixteen/functions.php
    index d098a1ebde..b07df1e8b0 100644
    if ( ! function_exists( 'twentysixteen_setup' ) ) : 
    4949                 * Make theme available for translation.
    5050                 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen
    5151                 * If you're building a theme based on Twenty Sixteen, use a find and replace
    52                  * to change 'twentysixteen' to the name of your theme in all the template files
     52                 * to change 'twentysixteen' to the name of your theme in all the template files.
     53                 * Manual loading of text domain is not required after the introduction of
     54                 * just in time loading for translations in WordPress version 4.6.
    5355                 */
    54                 load_theme_textdomain( 'twentysixteen' );
     56                if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     57                        load_theme_textdomain( 'twentysixteen' );
     58                }
    5559
    5660                // Add default posts and comments RSS feed links to head.
    5761                add_theme_support( 'automatic-feed-links' );
  • src/wp-content/themes/twentyten/functions.php

    diff --git src/wp-content/themes/twentyten/functions.php src/wp-content/themes/twentyten/functions.php
    index 8bda350d40..21e9741e6b 100644
    if ( ! function_exists( 'twentyten_setup' ) ) : 
    128128                /*
    129129                 * Make theme available for translation.
    130130                 * Translations can be filed in the /languages/ directory.
     131                 * Manual loading of text domain is not required after the introduction of
     132                 * just in time loading for translations in WordPress version 4.6.
    131133                 */
    132                 load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
     134                if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     135                        load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
     136                }
    133137
    134138                // This theme uses wp_nav_menu() in one location.
    135139                register_nav_menus(
  • src/wp-content/themes/twentythirteen/functions.php

    diff --git src/wp-content/themes/twentythirteen/functions.php src/wp-content/themes/twentythirteen/functions.php
    index 8383b4cba3..1cc0ff1bde 100644
    function twentythirteen_setup() { 
    7575         * If you're building a theme based on Twenty Thirteen, use a find and
    7676         * replace to change 'twentythirteen' to the name of your theme in all
    7777         * template files.
     78         * Manual loading of text domain is not required after the introduction of
     79         * just in time loading for translations in WordPress version 4.6.
    7880         */
    79         load_theme_textdomain( 'twentythirteen' );
     81        if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     82                load_theme_textdomain( 'twentythirteen' );
     83        }
     84       
    8085
    8186        /*
    8287         * This theme styles the visual editor to resemble the theme style,
  • src/wp-content/themes/twentytwelve/functions.php

    diff --git src/wp-content/themes/twentytwelve/functions.php src/wp-content/themes/twentytwelve/functions.php
    index de535ac5f2..747cf13a91 100644
    function twentytwelve_setup() { 
    5151         * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentytwelve
    5252         * If you're building a theme based on Twenty Twelve, use a find and replace
    5353         * to change 'twentytwelve' to the name of your theme in all the template files.
     54         * Manual loading of text domain is not required after the introduction of
     55         * just in time loading for translations in WordPress version 4.6.
    5456         */
    55         load_theme_textdomain( 'twentytwelve' );
     57        if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
     58                load_theme_textdomain( 'twentytwelve' );
     59        }
     60       
    5661
    5762        // This theme styles the visual editor with editor-style.css to match the theme style.
    5863        add_editor_style();
  • src/wp-content/themes/twentytwenty/functions.php

    diff --git src/wp-content/themes/twentytwenty/functions.php src/wp-content/themes/twentytwenty/functions.php
    index 38fc4d8a48..f94f42f055 100644
    function twentytwenty_theme_support() { 
    111111                )
    112112        );
    113113
    114         /*
    115          * Make theme available for translation.
    116          * Translations can be filed in the /languages/ directory.
    117          * If you're building a theme based on Twenty Twenty, use a find and replace
    118          * to change 'twentytwenty' to the name of your theme in all the template files.
    119          */
    120         load_theme_textdomain( 'twentytwenty' );
    121 
    122114        // Add support for full and wide align images.
    123115        add_theme_support( 'align-wide' );
    124116
  • src/wp-content/themes/twentytwentyone/functions.php

    diff --git src/wp-content/themes/twentytwentyone/functions.php src/wp-content/themes/twentytwentyone/functions.php
    index ffbae09ad8..cb56b5cfdd 100644
    if ( ! function_exists( 'twenty_twenty_one_setup' ) ) { 
    2727         * @return void
    2828         */
    2929        function twenty_twenty_one_setup() {
    30                 /*
    31                  * Make theme available for translation.
    32                  * Translations can be filed in the /languages/ directory.
    33                  * If you're building a theme based on Twenty Twenty-One, use a find and replace
    34                  * to change 'twentytwentyone' to the name of your theme in all the template files.
    35                  */
    36                 load_theme_textdomain( 'twentytwentyone', get_template_directory() . '/languages' );
    3730
    3831                // Add default posts and comments RSS feed links to head.
    3932                add_theme_support( 'automatic-feed-links' );