Last active
June 2, 2023 15:10
-
-
Save devuri/034ccb7c833f970192bb64317814da3b to your computer and use it in GitHub Desktop.
Revisions
-
devuri revised this gist
Jun 2, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ /** * Prevent Admin users from deactivating plugins. * * While this will remove the deactivation link it does NOT prevent deactivation * It will only hide the link to deactivate. */ add_filter( 'plugin_action_links', function ( $actions, $plugin_file, $plugin_data, $context ) { -
devuri created this gist
Jun 2, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php /** * Prevent Admin users from deactivating plugins. * * While this will remove the deactivation link id does NOT prevent deactivation * It will only hide the link to deactivate. */ add_filter( 'plugin_action_links', function ( $actions, $plugin_file, $plugin_data, $context ) { if ( array_key_exists( 'deactivate', $actions ) ){ unset( $actions['deactivate'] ); } return $actions; }, 10, 4 );