Backport: Add the Behaviors UI#4526
Backport: Add the Behaviors UI#4526michalczaplinski wants to merge 4 commits intoWordPress:trunkfrom
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. |
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks @michalczaplinski, Left some nitpick feedback.
| * | ||
| * @package WordPress | ||
| * @since 6.3.0 | ||
| * |
| * @since 6.3.0 | ||
| * @param array $editor_settings The array of editor settings. |
There was a problem hiding this comment.
| * @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.
Instead if array_key_exists use isset
| // User preferences. | ||
| add_action( 'init', 'wp_register_persisted_preferences_meta' ); | ||
|
|
||
| // Behaviors |
There was a problem hiding this comment.
| // 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.