-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Core hooks fired in incorrect order, breaks CMB library #4929
Comments
The underlying cause is that the |
Do you have a workaround, such as hooking into |
I don't have a workaround yet but I'm looking into it. |
I believe that the following is a workaround for this particular issue, but it's not been extensively tested. If anyone else has the same issue, feedback would be welcome. add_action( 'admin_enqueue_scripts', function() {
do_action( 'dbx_post_advanced', $GLOBALS['post'] );
remove_all_actions( 'dbx_post_advanced' );
}, -999 ); |
If it doesn't fire on |
From #7000 (comment)
I think we may need to revert back to the existing order and have ACF include some form of compatibility shim. |
@jsternberg Hi! Hope you don't mind the ping. Are you aware if this issue affects CMB2? |
Hi, I think you might have pinged the wrong person. I do not know what the acronym CMB2 stands for so I'm unlikely to know if this issue affects it. |
Sorry! @jtsternberg is who I was after :-) |
👋Looks like I'm too late as #10660 has resolved it. Sorry I missed the ping. |
Issue Overview
The way in which Gutenberg loads meta boxes causes it to trigger core actions in the incorrect order on the post editing screen. One problem that this causes is to break meta boxes which are registered with the CMB library because the
admin_enqueue_scripts
action fires before the fields are registered, causing JavaScript files to not get enqueued.Steps to Reproduce (for bugs)
dbx_post_advanced
action fires before theadmin_enqueue_scripts
hook.Expected Behavior
The
dbx_post_advanced
hook fires before theadmin_enqueue_scripts
hook.Current Behavior
The
admin_enqueue_scripts
hook fires before thedbx_post_advanced
hook./cc @mikeselander @mattheu
The text was updated successfully, but these errors were encountered: