WordPress Snippet
Last active
October 2, 2019 13:56
-
-
Save ControlledChaos/c2d659ebf1824296f636f9d9c2a2fbba to your computer and use it in GitHub Desktop.
Remove plugin entries from the list on the WordPress Plugins page.
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 | |
function ccd_remove_plugin_entries( $plugins ) { | |
// Get plugin page URLs from the activate/deactivate links | |
$hidden = array( | |
'jetpack/jetpack.php', | |
'beaver-builder/fl-builder.php' | |
); | |
if ( isset( $_GET['showall'] ) && $_GET['showall'] == '1' ) { | |
return $plugins; | |
} | |
foreach ( $hidden as $filename ) { | |
unset( $plugins[ $filename ] ); | |
} | |
return $plugins; | |
} | |
add_filter( 'all_plugins', 'ccd_remove_plugin_entries' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment