WordPress:重命名工具栏链接 [英] Wordpress: rename Toolbar link

查看:71
本文介绍了WordPress:重命名工具栏链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要重命名工具栏链接,看一下捕获内容以了解我的意思.

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

我发现这行代码删除了链接 $ wp_adminbar-> remove_node('wp-logo');

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

但是没有什么可以重命名"的.

But nothing to 'rename'.

推荐答案

此问题您可以使用 gettext WordPress过滤器在插件或主题 functions.php 文件中实现菜单的重命名:

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 );

这篇关于WordPress:重命名工具栏链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆