Forked from wpscholar/hide-plugin-deactivation.php
Created
September 20, 2017 22:41
-
-
Save jimboobrien/1a14df146aa035719a0bd68578a3f533 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Drop this code into your main plugin file to hide plugin deactivation from the WordPress admin. | |
*/ | |
add_filter( 'plugin_action_links', function ( $actions, $plugin_file ) { | |
if ( plugin_basename( __FILE__ ) === $plugin_file ) { | |
unset( $actions['deactivate'] ); | |
} | |
return $actions; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment