-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gutenblocks: Try Module Activation State based Visibility #10243
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
This is automated check which relies on Generated by 🚫 dangerJS |
fbbb276
to
864dd54
Compare
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.
I realize the PR is not yet marked for review; just noticed the anonymous function and wanted to flag that. Would still need a formal review whenever it is ready.
@@ -294,3 +294,6 @@ function setting_html() { | |||
} | |||
|
|||
add_action( 'init', array( 'Jetpack_Tiled_Gallery', 'init' ) ); | |||
add_action( 'init', function() { |
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.
Before this could be merged, it would need to be converted to a function. Anonymous functions aren't allowed in PHP 5.2.
I see some advantages to building a single script from the SDK, enqueuing it, and exposing the necessary data to determine which blocks to load.
|
Related: #10198 |
Closing as this has now been replaced by #10327 |
Closes #10243 (supersedes) Part of #10198 Calypso (block) PR in progress: Automattic/wp-calypso#27875 This is the simplest way of reusing an existing data set to expose some required data for blocks to access. #### Changes proposed in this Pull Request: * Exposes `Jetpack_Initial_State` global. This is the same data used by the React-based dashboard/settings views #### Testing instructions: * Load the Gutenberg editor with Jetpack blocks available * Observe the `Jetpack_Initial_State` global is available in the console
WIP, doesn't work yet. It's late, going to debug tomorrow.
Trying to implement what we discussed on our video call earlier today -- loading block assets (and registering them) only if the corresponding module is active.
To test:
_inc/blocks/
, if any._inc/blocks/tilled-gallery/
.(Doesn't work yet)
TODO: