-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post Terms Block: Custom Taxonomies variations are not registered correctly #52569
Comments
Thinking about proposed solution 2: |
I've tried a first attempt at solving this with my solution 1 from the op. I don't think it's good to go yet, but I wanted to try how that would work on the editor side. |
Hi, |
The problem described in the original issue is still there in current trunk and the reproducation steps still apply. |
Hi, |
Was fixed in 2c247e2 via the new |
Description
In #39837 (fix for #32924) support was added so that for all public taxonomies, variations of the core/post-terms block were added. But the hook to check for public taxonomies is run on
init
with a default priority of 10.It's safe to asume, that this will run before many plugins will have registered their custom taxonomies, because the core init hook is added earlier and 10 is the default priority (so many developers will register it on 10 as well).
Proposed solution:
register_block_core_post_terms
on a priority later than 10 (eg 100)Split the function and add variations add a later point via PHP(not possible because server side version to register block variations is missing)All other core blocks are registered on priority 10, so I think it would be a bit odd to run the register function for only this block on a later priority. Also of course we can't be 100% sure if on priority 100 all custom taxonomies are already registered (since developers also can use later priorities). So I guess I actually favor solution 2. Is there precedent for any solution like this?
I ran into this problem multiple times, and in the original PR @mrleemon originally found this bug.
Step-by-step reproduction instructions
Negative test:
Positive test:
add_action
priority to something lower than 10 (eg 9)Screenshots, screen recording, code snippet
No response
Environment info
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
The text was updated successfully, but these errors were encountered: