WordPress Tutorial

WordPress hides the left bar menu added by plug-ins and themes in the background

 Alibaba Cloud

WordPress hides the left column menu added by plug-ins and themes in the background. Some plug-ins and themes will add menus in the left column of the background after they are enabled. Although it is convenient to open the setting page, it is not convenient to open more left column menus, and you can hide some unnecessary menus.

  1.  add_action (  'admin_menu' ,  function  ( )  {
  2.  remove_menu_page ( 'Settings page for plugin 1' ) ;
  3.  remove_menu_page ( 'Settings page for plugin 2' ) ;
  4.  } ,  nine thousand nine hundred and ninety-nine  ) ;
Want to be here? contact us bar
 Maker host

section

section

View address, copy? Page=the following text (excluding the parameters after the configuration page name, for example:? Page=xxxxx # tab, # tab does not need to be filled in)

section

Open the template function file functions.php of the current theme, and add the code to this file.

If you are worried that the user may miss the background function and want to block some plug-ins, such as WordPress background plug-in list, add the following code to the current WordPress template functions.php function file, and then modify the plug-in path to be hidden as needed.

  1.  function mk_hide_plugins (  $plugins  ) {
  2.   
  3.    //Hide xxx plug-in
  4.    $plugin  =  'wp-crontrol/wp-xxx.php' ;
  5.    if ( is_plugin_active (  $plugin  )  )  unset (  $plugins [ $plugin ]  ) ;
  6.   
  7.    //Hide 666 plug-in
  8.    $plugin  =  'user-switching/666.php' ;
  9.    if ( is_plugin_active (  $plugin  )  )  unset (  $plugins [ $plugin ]  ) ;
  10.   
  11.    return  $plugins ;
  12.  }
  13.  add_filter (  'all_plugins' ,  'mk_hide_plugins'  ) ;

Note that the above code takes effect, and the plug-in will be hidden in the list only when it is enabled.

WordPress hides the left bar menu added by plug-ins and themes in the background

197 people have bought
View Demo Upgrade VIP Buy Now

Collection
fabulous ( zero )

Post reply

Hot selling template

Ashade - Works exhibition photo album WordPress Chinese theme
 LensNews

This site accepts WordPress/PbootCMS/DedeCMS, etc
System construction, imitation, development, customization and other services!