Created
January 20, 2022 17:06
-
-
Save thisbit/b6d081ccf83cf20f9b3f2ece4ac335e1 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 | |
// best put in theme that depends on certain plugins | |
add_filter( 'plugin_action_links', 'disable_plugin_deactivation', 10, 4 ); | |
function disable_plugin_deactivation( $actions, $plugin_file, $plugin_data, $context ) { | |
if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array( | |
'advanced-custom-fields/acf.php', | |
'gp-premium/gp-premium.php' | |
))) | |
unset( $actions['deactivate'] ); | |
return $actions; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment