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

[Navigation] enqueue_block_editor_assets action is not fired #21648

Closed
manmotive opened this issue Apr 16, 2020 · 1 comment · Fixed by #30076
Closed

[Navigation] enqueue_block_editor_assets action is not fired #21648

manmotive opened this issue Apr 16, 2020 · 1 comment · Fixed by #30076
Assignees
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@manmotive
Copy link

manmotive commented Apr 16, 2020

Describe the bug
I am attempting to follow this guide to add a button to the menu item toolbar:

https://developer.wordpress.org/block-editor/tutorials/format-api/1-register-format/

It appears that the "enqueue_block_editor_assets" action is not fired on the /wp-admin/admin.php?page=gutenberg-navigation page.

To reproduce

  1. Add the following to a plugin or your theme:
function my_custom_format_enqueue_assets_editor() {
    die("got here");
}
add_action( 'enqueue_block_editor_assets', 'my_custom_format_enqueue_assets_editor' );
  1. Visit /wp-admin/admin.php?page=gutenberg-navigation

Expected behavior
I would expect to see the message "got here", but I do not as the action is not fired on the new Navigation page. If I edit a page or post I see the "got here" message.

Editor version:

  • WordPress version: 5.4
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Gutenberg plugin
  • If the Gutenberg plugin is installed, which version is it? 7.9
@talldan talldan added [Type] Developer Documentation Documentation for developers Needs Testing Needs further testing to be confirmed. labels Apr 20, 2020
@noisysocks noisysocks removed the Needs Testing Needs further testing to be confirmed. label Nov 10, 2020
@noisysocks
Copy link
Member

Possibly related to #25826.

We likely need to add this code which is on widgets-page.php to navigation-page.php as well:

function gutenberg_widgets_editor_load_block_editor_scripts_and_styles( $is_block_editor_screen ) {
if ( is_callable( 'get_current_screen' ) && 'appearance_page_gutenberg-widgets' === get_current_screen()->base ) {
return true;
}
return $is_block_editor_screen;
}
add_filter( 'should_load_block_editor_scripts_and_styles', 'gutenberg_widgets_editor_load_block_editor_scripts_and_styles' );

@noisysocks noisysocks added [Feature] Extensibility The ability to extend blocks or the editing experience [Type] Bug An existing feature does not function as intended and removed [Type] Developer Documentation Documentation for developers labels Nov 10, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants