-
Notifications
You must be signed in to change notification settings - Fork 365
Blockbase: Only display font customizer options if not enabled in site editor #5976
Blockbase: Only display font customizer options if not enabled in site editor #5976
Conversation
| $gutenberg_webfonts_api_supports_enqueueing = version_compare( GUTENBERG_VERSION, '13.0', '>=' ); | ||
| } | ||
|
|
||
| return $jetpack_has_google_fonts_module && $gutenberg_webfonts_api_supports_enqueueing && Jetpack::is_module_active( 'google-fonts' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Jetpack::is_module_active always returns true for dotcom simple regardless of what value is passed to it. Unsure why at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeyip yup that is by design. From a code comment on WPCOM_Site::is_module_active:
Always returns true. In Jetpack context it would actually check if a module is active or not because the module loading relies on the 'jetpack_active_modules' option. Here in WordPress.com context however, we always load everything, so in order to enable or disable something we have to check each module's settings.
|
Is this still a WIP or can the themes team review too? |
|
@MaggieCabrera You're welcome to review, but know this is very much a work in progress. We need to figure out how to migrate the legacy Blockbase Customizer settings so they don't prevent other Global Style font families from displaying, like what's happening now (as tracked in Automattic/wp-calypso#63229). Once that's figured out, users can use the Global styles options to set font families, rather than the Customizer options, so we're thinking the Customizer options aren't needed. Please do let us know if you have thoughts or ideas on this! |
|
Hurray! Your theme supports Full Site Editing with blocks. Tell me more. In the customizer, Tell me more opens to a .org document: https://wordpress.org/support/article/site-editor/ |
It is very cool to see that you all picked up on this. We built Blockbase with this moment in mind: when Blockbase was created there was no option for color or font customization on block themes, and we decided to bridge that gap using the customizer, but knowing that the future (now the present!) would bring a solution that would work directly in the FSE, we wanted our implementation to be compatible with that. I'd have to review the code again but the idea was that the customizer options selected by the user would get saved in the |
| $gutenberg_webfonts_api_supports_enqueueing = false; | ||
|
|
||
| if ( defined( 'JETPACK__VERSION' ) ) { | ||
| $jetpack_has_google_fonts_module = JETPACK__VERSION === 'wpcom' || version_compare( JETPACK__VERSION, '10.8', '>' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:
Remove unnecessary reference to wpcom. We control all versioning for Jetpack, Gutenberg, and jetpack modules for simple sites.
|
Logic from this PR has been incorporated into #6010 |
Description
More context can be found here paYE8P-1B3-p2#comment-1506.
This PR displays a deprecation notice in the blockbase font customizer if gutenberg and jetpack have the correct versions and configurations to have site editor google fonts enabled.
NOTE: For dotcom simple sites
Screenshots
Before
After
Testing
blockbase/inc/customizer/wp-customize-fonts.phpto its mirrored file in the dotcom codebasewp-content/themes/pub/blockbase/inc/customizer/wp-customize-fonts.phpRelated issue(s):
Automattic/wp-calypso#63229