From d154c278d3b455e10340de793bd0fe0a6d1368b0 Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Wed, 13 Nov 2024 13:56:31 +0100 Subject: [PATCH] Fix loading of localized labels with WordPress 6.7.0 (#765) --- functions/s.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/s.php b/functions/s.php index 34d95821..8c7578a7 100644 --- a/functions/s.php +++ b/functions/s.php @@ -28,7 +28,12 @@ function sunflower_setup() { * If you're building a theme based on sunflower, use a find and replace * to change 'sunflower' to the name of your theme in all the template files. */ - load_theme_textdomain( 'sunflower', get_template_directory() . '/languages' ); + // Hack for WordPress 6.7.0. + if ( version_compare( $GLOBALS['wp_version'], '6.7', '<' ) ) { + load_theme_textdomain( 'sunflower', get_template_directory() . '/languages' ); + } else { + load_textdomain( 'sunflower', get_template_directory() . '/languages/' . determine_locale() . '.mo' ); + } // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' );