Created
August 20, 2015 17:17
-
-
Save wpscholar/c5e7f83c0350b4246623 to your computer and use it in GitHub Desktop.
This file contains 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