cmb2-extension icon indicating copy to clipboard operation
cmb2-extension copied to clipboard

How to allow do_scripts on custom hooks?

Open bfiessinger opened this issue 3 years ago • 0 comments

I was a little bit confused when I saw none of the styles where enqueued on my custom options page. After browsing the code I saw all scripts and styles are conditionally loaded on predefined hooks.

Now I made a little hacky solution with adding two more lines to CMB_Extension_Hookup.php:

if ( defined('CMB_EXTENSIONS_ASSETS_ADDITIONAL_HOOKS') && is_array(CMB_EXTENSIONS_ASSETS_ADDITIONAL_HOOKS) )
  $hooks = array_merge( $hooks, CMB_EXTENSIONS_ASSETS_ADDITIONAL_HOOKS );

Then theres a comment below the allowed hooks which says: // show_form_for_type will have us covered if we miss something here.

Sadly I did not find any reference to show_form_for_type. Is there any?

bfiessinger avatar Jul 16 '20 12:07 bfiessinger