Enable Theme and Plugin Editor on WordPress MU

 

If you have installed WordPress MU and like to have the theme editor and plugin editor for easy customization of themes and plugin from dashboard (like normal wordpress), then here is the customization technique to get the same. For those who are new to WordPress MU , there is no provision for tabs as “Theme Editor” under Appearance section and “Plugin Editor” under Plugins section on Dashboard in WPMU.

Theme/Plugin Editor in WordPress MU

To get the theme editor panel in WPMU, follow the below steps,

Edit MU.PHP file

To get the editor on dashboard, you will have to edit the mu.php file available under “wp-admin/includes” folder of your WordPress MU installation.

Wordpress mu.php

1. Search for the term “unset( $submenu['themes.php'][10]” in mu.php, you will find only one search result. At that place, you ned to make changes. We have provided below the before and after changes code. We need to comment two lines which are actually there to remove plugin editor and theme editor.

Before Changes
unset( $submenu['plugins.php'][15] ); // always remove the plugin editor
unset( $submenu['themes.php'][10] );  // always remove the themes editor
After Changes
/* unset( $submenu['plugins.php'][15] ); */ // always remove the plugin
/* unset( $submenu['themes.php'][10] ); */ // always remove the themes

2. After removing this check, you should be able to see the theme editor and plugin editor option but still those pages will not accessible. To remove that barrier, you need to make below changes in mu.php only.

Search for the term “if ( strpos( $_SERVER['PHP_SELF'], ‘user-new.php’” in mu.php and then see below the before and after code for the same line (search result)

Before Changes
$pages = array( 'theme-editor.php', 'plugin-editor.php' );
foreach( $pages as $page ) {
    if ( strpos( $_SERVER['PHP_SELF'], $page ) ) {
        wp_die( __('Page disabled by the administrator') );
After Changes
$pages = array( 'theme-editor.php', 'plugin-editor.php' );
  foreach( $pages as $page ) {
     if ( strpos( $_SERVER['PHP_SELF'], $page )&& !is_site_admin() ) {
         wp_die( __('Page disabled by the administrator') );

Now you can check in your WordPress MU dashboard; the theme editor and plugin editor should work properly in your MU installation.

Note: if you are using WordPress MU 2.7 or below that then you will have to copy theme-editor.php from normal wordpress setup (wp-admin/theme-editor.php) to the same location in WPMU. After WPMU 2.7, WordPress started giving theme-editor.php with the installation setup.

 

原文链接:

http://www.clickonf5.org/wordpress-mu/enable-theme-plugin-editor-wordpress-mu/5790

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值