Fixed a bug after unregistering default media and text widgets
-
Hi,
I’ve created a couple of custom widgets and unregistered all WordPress default widgets, including media (audio, image, video) and text widgets.
Thus,
media-widgetsandtext-widgetsWordPress scripts are not called any more on the widgets admin panel, making Javascript objectswp.mediaWidgetsandwp.textWidgetsundefined.Your plugin breaks since it tries to access these global objects in
pw-media-widgets-extend-wp-media-widgets.jsandpw-text-widgets-extend-wp-text-widgets.js.I fixed it by adding :
wp_enqueue_script('media-widgets'); wp_enqueue_script('text-widgets');near the end of your
pw_print_scriptsPHP function.Can you please include this fix in the next release of your plugin?
Thanks,
Vincent
The topic ‘Fixed a bug after unregistering default media and text widgets’ is closed to new replies.