Skip to content

Commit

Permalink
Bundled Themes: Cast font URL functions to string for `add_editor_s…
Browse files Browse the repository at this point in the history
…tyle()`.

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
  • Loading branch information
audrasjb committed Feb 12, 2024
1 parent ef53283 commit e1f0ce5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfifteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function 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 ) );

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfourteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function 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' ) );

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyseventeen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentysixteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function 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 ) );

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentythirteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand Down

0 comments on commit e1f0ce5

Please sign in to comment.