Skip to content

Commit d154c27

Browse files
authored
Fix loading of localized labels with WordPress 6.7.0 (#765)
1 parent c33cd17 commit d154c27

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

functions/s.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ function sunflower_setup() {
2828
* If you're building a theme based on sunflower, use a find and replace
2929
* to change 'sunflower' to the name of your theme in all the template files.
3030
*/
31-
load_theme_textdomain( 'sunflower', get_template_directory() . '/languages' );
31+
// Hack for WordPress 6.7.0.
32+
if ( version_compare( $GLOBALS['wp_version'], '6.7', '<' ) ) {
33+
load_theme_textdomain( 'sunflower', get_template_directory() . '/languages' );
34+
} else {
35+
load_textdomain( 'sunflower', get_template_directory() . '/languages/' . determine_locale() . '.mo' );
36+
}
3237

3338
// Add default posts and comments RSS feed links to head.
3439
add_theme_support( 'automatic-feed-links' );

0 commit comments

Comments
 (0)