Ad

Wordpress: Rename Toolbar Link

- 1 answer

I need to rename a Toolbar link, take a look at the capture to see what I mean.

I found this line of code to remove a link $wp_adminbar->remove_node('wp-logo');

But nothing to 'rename'.

enter image description here

Ad

Answer

From this question How rename a plugin title > Wordpress > Dashboard

You may use the gettext WordPress filter to achieve rename your menu in your plugin or theme functions.php file:

function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
    case 'Copy to a new draft' :
        $translated_text = 'CLONE';
        break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
Ad
source: stackoverflow.com
Ad