Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mehdi-eybak/99fe22e63d2a7480a2074859e527fffb to your computer and use it in GitHub Desktop.
Save mehdi-eybak/99fe22e63d2a7480a2074859e527fffb to your computer and use it in GitHub Desktop.
Use the filter below to delete the information of the plugin installed in WordPress and the WordPress plugins page. Note that in the first value, put the folder and the main file of the plugin, and in the second value, only the main file of the plugin without adding the folder.
<?php
add_filter( 'all_plugins', function ( $plugins ) {
$shouldHide = ! array_key_exists( 'show_all', $_GET );
if ( $shouldHide ) {
$hiddenPlugins = [
'woocommerce-checkout-manager/woocommerce-checkout-manager.php',
'woocommerce-checkout-manager.php',
];
foreach ( $hiddenPlugins as $hiddenPlugin ) {
unset( $plugins[ $hiddenPlugin ] );
}
}
return $plugins;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment