Cloudinary breaks WP Webhooks
-
Hey guys,
we received a couple of requests that your plugin is breaking the functionality of WP Webhooks on its own plugin pages.
After some quick tests, we could confirm that as you are loading your scripts and styles globally (cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-plugin.php:344
)The received error:
cloudinary.js?ver=2.7.3:1 Uncaught TypeError: Cannot read property 'classList' of null at HTMLButtonElement.<anonymous> (cloudinary.js?ver=2.7.3:1)
Please only load the required scripts and styles on pages that really require it as everything else is bad practice.
For everyone who faces that issue in the meantime and looks for a solution: You can simply dequeue the scripts on the pages of WP Webhooks.
To do that, just add the following snippet into your functions.php file of your theme:add_action( 'wp_print_scripts', 'deregister_script_on_wp_webhooks_pages', PHP_INT_MAX ); function deregister_script_on_wp_webhooks_pages() { if( function_exists( 'WPWHPRO' ) ){ if( WPWHPRO()->helpers->is_page( WPWHPRO()->settings->get_page_name() ) ){ wp_deregister_script( 'cloudinary' ); wp_dequeue_script( 'cloudinary' ); } } }
Do reach out in case you need further details.
The page I need help with: [log in to see the link]
- The topic ‘Cloudinary breaks WP Webhooks’ is closed to new replies.