Skip to content

Instantly share code, notes, and snippets.

@goldhat
Created October 13, 2016 15:33
Show Gist options
  • Save goldhat/1cc7edc7c7af0cc894c7bc5c81ed53bc to your computer and use it in GitHub Desktop.
Save goldhat/1cc7edc7c7af0cc894c7bc5c81ed53bc to your computer and use it in GitHub Desktop.
$wordpress_path = "/path/to/my/wordpress/install";
// may not be needed if inside WP and hooking into actions
// activate_plugin() is in plugin.php
require_once( $wordpress_path . "/wp-load.php" );
require_once( $wordpress_path . "/wp-admin/includes/plugin.php");
$plugins = array("cforms", "w3-total-cache", "wordpress-seo");
foreach ($plugins as $plugin){
$plugin_path = $wordpress_path."wp-content/plugins/{$plugin}.php";
activate_plugin($plugin_path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment