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-widgets
andtext-widgets
WordPress scripts are not called any more on the widgets admin panel, making Javascript objectswp.mediaWidgets
andwp.textWidgets
undefined.Your plugin breaks since it tries to access these global objects in
pw-media-widgets-extend-wp-media-widgets.js
andpw-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_scripts
PHP function.Can you please include this fix in the next release of your plugin?
Thanks,
Vincent
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Fixed a bug after unregistering default media and text widgets’ is closed to new replies.