• Resolved robertosalemi

    (@robertosalemi)


    Hello everyone,
    I can rename in functions.php, the name of a plug-in appears in the sidebar?

    I tried with:

    function rename_admin_menu_items( $menu ) {
            $menu = str_ireplace( 'Articoli', 'Blog', $menu );
    	return $menu;
    }
    
    add_filter('gettext', 'rename_admin_menu_items');
    add_filter('ngettext', 'rename_admin_menu_items');

    But it only works with the standard label WordPress.

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter robertosalemi

    (@robertosalemi)

    Risolto.

    The problem concerns the identification of the correct name of the item in this sidebar.

    I’m using following code to DEBUG:

    function wpse_136058_debug_admin_menu() {
        echo '
    '.print_r($GLOBALS['menu'], true).'
    ';
    }
    add_action('admin_init', 'wpse_136058_debug_admin_menu');

    I can see:

    [23] => Array
            (
                [0] => WP Bannerize
                [1] => edit_posts
                [2] => wp-bannerize-mainshow
                [3] => WP Bannerize
                [4] => menu-top toplevel_page_wp-bannerize-mainshow
                [5] => toplevel_page_wp-bannerize-mainshow
                [6] => https://10.1.0.128:8080/wp-content/plugins/wp-bannerize/css/images/wp-bannerize-16x16.png
            )

    so i wrote
    $menu = str_ireplace( 'WP Bannerize', 'Gestione banner', $menu );

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Rename the label of a plugin in the sidebar admin’ is closed to new replies.