Open obache opened 1 year ago
I have been able to replicate this issue. For reference, this feature was introduced in #29095.
FYI: This has been fixed in https://github.com/WordPress/gutenberg/pull/54801
How about unregister_post_type()
and unregister_taxonomy()
?
How about
unregister_post_type()
andunregister_taxonomy()
?
@obache That's a great point that I've missed. I've added a new PR which fixes this as well: https://github.com/WordPress/gutenberg/pull/56100
As part of this larger sweep of high priority issues, I'm removing the label here as the main part of the issue has been resolved with an additional PR in progress and already approved to iterate. Re-running the jobs to see if we can get that merged sooner rather than later. Let me know if you need more help getting this through @gaambo too :)
Description
register_block_core_navigation_link()
ofnavigation-link
block will use registeredpost_type
andtaxonomy
, then register variations of navigation-link block. It will be done asinit
hook with default priority now.But from functions references
register_post_type()
: Post type registrations should not be hooked before the ‘init’ action.register_taxnomy()
: Do not use before the ‘init’ hook.So custom post types and taxonomies may not be registered yet at
register_block_core_navigation_link()
doing, and such post type links and taxonomy archive links are not appeared as blocks for navigation menu.In "Registering Custom Post Types" of "Plugin Handbook", custom post type is registered as
init
hook with default priority10
, so it should be usual timing to register custom post type for plugins , but archive link for such registered post type will not be appeared as blocks. If post types is registered asinit
hook with priority9
, such post types will be appeared.register_block_core_navigation_link()
should be done afterinit
hook, or lower priority.Step-by-step reproduction instructions
init
hook with default priorityScreenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes