April 17, 2014

How activate a WordPress plugin from your php script?

How activate a WordPress plugin from your php script?

e.g. Plugin Name: marketpress
if(is_admin()){
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( !is_plugin_active( 'marketpress/marketpress.php' ) ) {
do_action( 'activate_' . trim( 'marketpress' ) );
}
}

Last updated: April 17, 2014