-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Backport: Add the Behaviors UI #4526
Backport: Add the Behaviors UI #4526
Conversation
@michalczaplinski Aside from the WPCS issues, the unit tests are failing because the behaviors.php file isn't included. This should probably be added in wp-settings.php, but I am not 100% sure where this would best fit. |
Ok, fixed it.
I'm also not 100% sure if this is the best place, but I've put it there like you suggested. |
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.
Thanks @michalczaplinski, Left some nitpick feedback.
* | ||
* @package WordPress | ||
* @since 6.3.0 | ||
* |
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.
* |
* @since 6.3.0 | ||
* @param array $editor_settings The array of editor settings. |
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.
* @since 6.3.0 | |
* @param array $editor_settings The array of editor settings. | |
* @since 6.3.0 | |
* | |
* @param array $editor_settings The array of editor settings. |
*/ | ||
function wp_add_behaviors( $settings ) { | ||
$theme_data = WP_Theme_JSON_Resolver::get_merged_data()->get_data(); | ||
if ( array_key_exists( 'behaviors', $theme_data ) ) { |
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.
Instead if array_key_exists
use isset
@@ -720,4 +720,7 @@ | |||
// User preferences. | |||
add_action( 'init', 'wp_register_persisted_preferences_meta' ); | |||
|
|||
// Behaviors |
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.
// Behaviors | |
// Behaviors. |
We can close this backport as it will be punted for 6.4 - I guess for that time there will be different code. |
It looks like this will be postponed until 6.4. See @c4rl0sbr4v0's comment: WordPress/gutenberg#51077 (comment) |
Behaviors have been removed from the Gutenberg plugin in WordPress/gutenberg#53851. An updated implementation of the Image Lightbox has been created in WordPress/gutenberg#54509 where the Lightbox is not a Behavior but a feature of the Image block. The above PRs have a corresponding backport in #5248 In the light of all that, we can now close this PR. |
Backport the PR that introduced the Behaviors UI in the block editor:
Trac ticket: https://core.trac.wordpress.org/ticket/58431
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.