Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to hide the installed WordPress plug-in

Shulou Source: shulou.com Published: 2022-06-02 05:06:47 11月16日 Update

Editor to share with you how to hide the installed WordPress plug-ins, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Add the following code to the current theme functions.php file:

Function hide_plugin_trickspanda () {global $wp_list_table; $hidearr = array ('plugin-directory/plugin-file.php'); $myplugins = $wp_list_table- > items; foreach ($myplugins as $key = > $val) {if (in_array ($key,$hidearr)) {unset ($wp_list_table- > items [$key]);}} add_action (' pre_current_active_plugins', 'hide_plugin_trickspanda')

Just modify the plugin-directory/plugin-file.php to prepare the hidden plug-in directory and file name.

Hiding multiple plug-ins can be written as follows:

Array ('wp-postviews/wp-postviews.php','akismet/akismet.php')

If it is multiple sites, you can use the following code:

Function mu_hide_plugins_network ($plugins) {/ / let's hide akismet if (in_array ('akismet/akismet.php', array_keys ($plugins) {unset ($plugins [' akismet/akismet.php']);} return $plugins;} add_filter ('all_plugins',' mu_hide_plugins_network'); above is how to hide all the contents of the installed WordPress plugin. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Plug-ins code content files articles not much topics multiple most file names more directories knowledge sites industry information information channels channels preparation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno Xiaomi Shulou Tech Info NVidia