如何重命名wordpress插件的菜单标签?

时间:2018-07-10 08:02:19

标签: php wordpress

我正在尝试在wordpress管理菜单中重命名插件标签。重命名后,该插件将无法使用。

更改名称之前:

function bookacti_create_menu() {
    // Add a menu and submenus
    $icon_url = 'dashicons-calendar-alt';
    add_menu_page( __( 'Booking Activities', BOOKACTI_PLUGIN_NAME ), _x( 'Booking Activities', 'Name of the tab in the menu', BOOKACTI_PLUGIN_NAME ), 'bookacti_manage_booking_activities', 'booking-activities', null, $icon_url, '56.5' );
    add_submenu_page( 'booking-activities', _x( 'Booking Activities', 'Landing page title', BOOKACTI_PLUGIN_NAME ), _x( 'Home', 'Landing page tab name', BOOKACTI_PLUGIN_NAME ),'bookacti_manage_booking_activities',           'booking-activities',   'bookacti_landing_page' );
    add_submenu_page( 'booking-activities', __( 'Calendar editor', BOOKACTI_PLUGIN_NAME ),                          __( 'Calendar editor', BOOKACTI_PLUGIN_NAME ),              'bookacti_manage_templates',                    'bookacti_calendars',   'bookacti_templates_page' );
    add_submenu_page( 'booking-activities', __( 'Booking forms', BOOKACTI_PLUGIN_NAME ),                            __( 'Booking forms', BOOKACTI_PLUGIN_NAME ),                'bookacti_manage_forms',                        'bookacti_forms',       'bookacti_forms_page' );
    add_submenu_page( 'booking-activities', __( 'Bookings', BOOKACTI_PLUGIN_NAME ),                                 __( 'Bookings', BOOKACTI_PLUGIN_NAME ),                     'bookacti_manage_bookings',                     'bookacti_bookings',    'bookacti_bookings_page' );
    add_submenu_page( 'booking-activities', __( 'Settings', BOOKACTI_PLUGIN_NAME ),                                 __( 'Settings', BOOKACTI_PLUGIN_NAME ),                     'bookacti_manage_booking_activities_settings',  'bookacti_settings',    'bookacti_settings_page' );
}
add_action( 'admin_menu', 'bookacti_create_menu' );

更改名称后:

function bookacti_create_menu() {
    // Add a menu and submenus
    $icon_url = 'dashicons-calendar-alt';
    add_menu_page( __( 'Testname', BOOKACTI_PLUGIN_NAME ), _x( 'Testname', 'Name of the tab in the menu', BOOKACTI_PLUGIN_NAME ), 'bookacti_manage_booking_activities', 'booking-activities', null, $icon_url, '56.5' );
    add_submenu_page( 'booking-activities', _x( 'Booking Activities', 'Landing page title', BOOKACTI_PLUGIN_NAME ), _x( 'Home', 'Landing page tab name', BOOKACTI_PLUGIN_NAME ),'bookacti_manage_booking_activities',           'booking-activities',   'bookacti_landing_page' );
    add_submenu_page( 'booking-activities', __( 'Calendar editor', BOOKACTI_PLUGIN_NAME ),                          __( 'Calendar editor', BOOKACTI_PLUGIN_NAME ),              'bookacti_manage_templates',                    'bookacti_calendars',   'bookacti_templates_page' );
    add_submenu_page( 'booking-activities', __( 'Booking forms', BOOKACTI_PLUGIN_NAME ),                            __( 'Booking forms', BOOKACTI_PLUGIN_NAME ),                'bookacti_manage_forms',                        'bookacti_forms',       'bookacti_forms_page' );
    add_submenu_page( 'booking-activities', __( 'Bookings', BOOKACTI_PLUGIN_NAME ),                                 __( 'Bookings', BOOKACTI_PLUGIN_NAME ),                     'bookacti_manage_bookings',                     'bookacti_bookings',    'bookacti_bookings_page' );
    add_submenu_page( 'booking-activities', __( 'Settings', BOOKACTI_PLUGIN_NAME ),                                 __( 'Settings', BOOKACTI_PLUGIN_NAME ),                     'bookacti_manage_booking_activities_settings',  'bookacti_settings',    'bookacti_settings_page' );
}
add_action( 'admin_menu', 'bookacti_create_menu' );

我在日志中找不到任何有用的东西。

您可以在此处找到完整的文件:https://github.com/bookingactivities/booking-activities/blob/master/booking-activities.php

1 个答案:

答案 0 :(得分:0)

您可以尝试将其添加到functions.php文件中吗

In [5]: a.toarray()
Out[5]:
array([[ 1996.02681822,   567.51562002,   775.41907594],
       [  567.51562002,  -801.65406829, -1386.471875  ],
       [  775.41907594, -1386.471875  ,  -592.25891927]])