Bundled Themes: Cast font URL functions to string for add_editor_style().

This changeset ensures the result of the font URL functions is a `string` before using it in `add_editor_style()`, to avoid PHP warnings on child themes. This similarily updates Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, Twenty Sixteen, and Twenty Seventeen.

Props jordesign, SergeyBiryukov, sabernhardt, huzaifaalmesbah, shailu25.
Fixes #59704.





git-svn-id: https://develop.svn.wordpress.org/trunk@57601 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2024-02-12 21:46:14 +00:00
parent ef53283061
commit e1f0ce5f4b
5 changed files with 5 additions and 5 deletions

View File

@ -184,7 +184,7 @@ if ( ! function_exists( 'twentyfifteen_setup' ) ) :
$font_stylesheet = str_replace(
array( get_template_directory_uri() . '/', get_stylesheet_directory_uri() . '/' ),
'',
twentyfifteen_fonts_url()
(string) twentyfifteen_fonts_url()
);
add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', $font_stylesheet ) );

View File

@ -81,7 +81,7 @@ if ( ! function_exists( 'twentyfourteen_setup' ) ) :
$font_stylesheet = str_replace(
array( get_template_directory_uri() . '/', get_stylesheet_directory_uri() . '/' ),
'',
twentyfourteen_font_url()
(string) twentyfourteen_font_url()
);
add_editor_style( array( 'css/editor-style.css', $font_stylesheet, 'genericons/genericons.css' ) );

View File

@ -120,7 +120,7 @@ function twentyseventeen_setup() {
$font_stylesheet = str_replace(
array( get_template_directory_uri() . '/', get_stylesheet_directory_uri() . '/' ),
'',
twentyseventeen_fonts_url()
(string) twentyseventeen_fonts_url()
);
add_editor_style( array( 'assets/css/editor-style.css', $font_stylesheet ) );

View File

@ -147,7 +147,7 @@ if ( ! function_exists( 'twentysixteen_setup' ) ) :
$font_stylesheet = str_replace(
array( get_template_directory_uri() . '/', get_stylesheet_directory_uri() . '/' ),
'',
twentysixteen_fonts_url()
(string) twentysixteen_fonts_url()
);
add_editor_style( array( 'css/editor-style.css', $font_stylesheet ) );

View File

@ -93,7 +93,7 @@ function twentythirteen_setup() {
$font_stylesheet = str_replace(
array( get_template_directory_uri() . '/', get_stylesheet_directory_uri() . '/' ),
'',
twentythirteen_fonts_url()
(string) twentythirteen_fonts_url()
);
add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', $font_stylesheet ) );