is_plugin_active function doesn’t exist

That’s because the file in which is_plugin_active() is defined – wp-admin/includes/plugin.php – is only loaded in the admin, after your plugin is loaded.

Thus, you can only call it after ‘admin_init’ has fired:

function check_some_other_plugin() {
  if ( is_plugin_active('some-plugin.php') ) {
    ...
  }
}
add_action( 'admin_init', 'check_some_other_plugin' );

Leave a Comment