Check plugin is activated or not in wordpress


Please find below code to check plugin is activated or not.

include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ );
if ( is_plugin_active( ‘plugin-folder/plugin-file.php’ ) ) {
// activated.
}

Get root directory path : ABSPATH // root path

Get current plugin path : plugin_dir_path( __FILE__ )

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s