Conflict with other plugins using CSF
-
Hi! Congrats on the plugin, it’s great!
I am a developer myself and have a plugin here on the repository that has a small conflict with yours.
We are both using ‘Codestart Framework’ and we are both removing their assets from unnecessary pages, but what’s happening is that my plugin is removing the assets on your plugin page and your plugin is removing the assets on mine ??I have already fixed this issue and will be included in my next update.
I wanted to report this to you so you could check it and eventually also include a fix in your code, so it doesn’t affect my code.The relevant part of the code in your plugin is the following in the admin-hooks.php:
function wp_ulike_admin_init_controller() { global $pagenow; $has_ulike = isset( $_GET['page'] ) && strpos( $_GET['page'], WP_ULIKE_SLUG ) !== false; $has_assets = defined( 'WP_ULIKE_PRO_DOMAIN' ) && in_array( $pagenow, array( 'post.php', 'post-new.php' ) ); if( ! $has_ulike && ! $has_assets ) { remove_action( 'admin_enqueue_scripts', 'CSF::add_admin_enqueue_scripts', 20 ); remove_action( 'admin_footer', 'csf_set_icons' ); remove_action( 'customize_controls_print_footer_scripts', 'csf_set_icons' ); } } add_action( 'admin_init', 'wp_ulike_admin_init_controller' );
You could change this line:
$has_assets = defined( 'WP_ULIKE_PRO_DOMAIN' ) && in_array( $pagenow, array( 'post.php', 'post-new.php' ) );
to
$has_assets = defined( 'WP_ULIKE_PRO_DOMAIN' ) || in_array( $pagenow, array( 'post.php', 'post-new.php' ) );
And it would fix the issue. But this would also include CSF assets in other CPT pages, but I think it’s a compromise, until CSF doesn’t offer a better way.
What do you think?Cheers, Carlos
- The topic ‘Conflict with other plugins using CSF’ is closed to new replies.