Skip to content
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

Editor: add new parameter to hook when enqueuing block assets #3817

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
}

/**
* @global string $hook_suffix
* @global string $post_type
* @global WP_Post_Type $post_type_object
* @global WP_Post $post Global post object.
* @global string $title
* @global array $wp_meta_boxes
*/
global $post_type, $post_type_object, $post, $title, $wp_meta_boxes;
global $hook_suffix, $post_type, $post_type_object, $post, $title, $wp_meta_boxes;

$block_editor_context = new WP_Block_Editor_Context( array( 'post' => $post ) );

Expand Down Expand Up @@ -268,8 +269,11 @@ static function( $classes ) {
* `wp_enqueue_style` to add your functionality to the block editor.
*
* @since 5.0.0
* @since 6.2.0 Added the $hook_suffix parameter.
*
* @param string $hook_suffix The current admin page.
*/
do_action( 'enqueue_block_editor_assets' );
do_action( 'enqueue_block_editor_assets', $hook_suffix );

// In order to duplicate classic meta box behavior, we need to run the classic meta box actions.
require_once ABSPATH . 'wp-admin/includes/meta-boxes.php';
Expand Down