-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
When using the Save Changes option with Save Fonts ticked, we are getting the following error
PHP Fatal error: Uncaught TypeError: basename(): Argument #1 ($path) must be of type string, array given in ... wp-content\plugins\create-block-theme\admin\create-theme\theme-fonts.php:117
We think this error occurs when create block theme is trying to remove fonts that were created in theme.json with the old naming convention and where the src is stored in theme.json as an array e.g.
"fontFace": [
{
"fontFamily": "Ysabeau Office",
"fontStyle": "normal",
"fontWeight": "400",
"src": [
"file:./assets/fonts/ysabeau-office_normal_400.ttf"
]
},
We do not get the problem, when trying to remove fonts with the new naming convention where the src is stored as a string e.g.
"src": "file:./assets/fonts/S6uyw4BMUTPHvxw6XweuBCY.woff2"
We have managed to work around this by temporarily changing the line of code
$font_filename = basename( $font_face['src']);
to
$font_filename = basename( $font_face['src'][0]);
and removing fonts created the old way and reinstalling them the new way.
eMPai-git
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done