[wp-hackers] Block Specific Plugins

Stephen Rider wp-hackers at striderweb.com
Thu Apr 30 04:45:54 UTC 2015


Something like this will remove specific plugins any time WP calls the list of actives:

add_filter( 'option_active_plugins', 'filter_get_active_plugins' );
add_filter( 'transient_active_plugins', 'filter_get_active_plugins' );

function filter_get_active_plugins( $data ) {
	$blocked = array( <plugins you don’t want to allow> );
	foreach ($blocked as $plugin) {
		unset( $data[$plugin] );
	}
	sort( $data );
	return $data;
}

Some pseudo code there, but you get the idea.

-- 
Stephen Rider

wp-hackers at striderweb.com
http://striderweb.com/nerdaphernalia



> On Apr 29, 2015, at 4:01 PM, chris at 314media.com wrote:
> 
> Any function to block a specific plugins based on its repository name?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list