Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coulterpeterson/0eefdb38f5f327ca907393276c831616 to your computer and use it in GitHub Desktop.
Save coulterpeterson/0eefdb38f5f327ca907393276c831616 to your computer and use it in GitHub Desktop.
<?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