Hi!
please use this code bellow to check:
if(!function_exists(‘is_plugin_active’)){
include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ );
}
if ( is_plugin_active( ‘kingcomposer/kingcomposer.php’ ) ){
// do your code
}
Thanks for the code, but i want to display text ex. “King Composer plugin is required to use this plugin.”
if King Composer not activated then this text will display in plugins page.
Thanks
Please try this code bellow
function kc_admin_notice() {
$class = 'notice notice-warning';
$message = __( 'King Composer plugin is required to use this plugin.', 'text-domain' );
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
}
if(!function_exists('is_plugin_active')){
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
if ( !is_plugin_active( 'kingcomposer/kingcomposer.php' ) )
add_action( 'admin_notices', 'kc_admin_notice' );