scarstens
12/20/2014 - 11:37 PM

Use this in your plugin to make sure it loads last

Use this in your plugin to make sure it loads last

function my_plugin_load_last()
{
	$path = str_replace( WP_PLUGIN_DIR . '/', '', __FILE__ );
	if ( $plugins = get_option( 'active_plugins' ) ) {
		if ( $key = array_search( $path, $plugins ) ) {
			array_splice( $plugins, $key, 9999 );
			array_unshift( $plugins, $path );
			update_option( 'active_plugins', $plugins );
		}
	}
}