Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Created November 8, 2013 22:33
Show Gist options
  • Select an option

  • Save pdewouters/7378767 to your computer and use it in GitHub Desktop.

Select an option

Save pdewouters/7378767 to your computer and use it in GitHub Desktop.
change plugin active order
// Push Gravity Forms to the top of the list of plugins to make sure it's loaded before any add-ons
add_action("activated_plugin", array("GFForms", "load_first"));
}
public static function load_first() {
$plugin_path = basename(dirname(__FILE__)) . "/gravityforms.php";
$active_plugins = get_option('active_plugins');
$key = array_search($plugin_path, $active_plugins);
if ($key > 0) {
array_splice($active_plugins, $key, 1);
array_unshift($active_plugins, $plugin_path);
update_option('active_plugins', $active_plugins);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment