编辑:为了清楚起见,我只是添加了我要编辑的部分的屏幕截图:screenshot for clarity
我正在尝试使用我自己的内容创建和修改屏幕右上角的 WordPress 后端帮助选项卡,我尝试使用 codex 但不确定我是否正在查看正确的引用,无论它是否有效正确实现它但即使在默认使用状态下我尝试使用它也没有任何变化。这是我使用的引用:[codex 引用][2]
编辑 2:找到这篇关于如何编辑文本的文章,但似乎不起作用,它只是放置输出文本然后破坏它,这段代码是否已弃用,或者我在这里遗漏了什么,下面是发生的情况的屏幕截图以及网站使用的代码。使用索引,因为它似乎是仪表板的索引,但更改它具有相同的效果。 screenshot of how the code outputs
add_action('load-index-new.php','custom_help_page');
add_action('load-index.php','custom_help_page');
function custom_help_page() {
add_filter('contextual_help','custom_page_help');
}
function custom_page_help($help) {
// echo $help; // Uncomment if you just want to append your custom Help text to the default Help text
echo "<h5>Custom Help text</h5>";
echo "<p> HTML goes here.</p>";
}
------ 删除了旧代码,因为它不符合目的,上面是新的------
最佳答案
这可能有帮助:
How can I add a Submenu to the WordPress Admin Bar
Adjusting the admin toolbar menu
但要添加链接,您可以:
add_action( 'admin_bar_menu', 'toolbar_link_to_mypage', 999 );
function toolbar_link_to_mypage( $wp_admin_bar ) {
$args = array(
'id' => 'my_page',
'title' => 'My Page',
'href' => 'http://example.com/my-page/',
'meta' => array( 'class' => 'my-toolbar-page' )
);
$wp_admin_bar->add_node( $args );
}
罢工><罢工>罢工>
编辑:
要更改帮助选项卡,可以这样做:
关于php - WordPress 编辑管理员帮助选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33083872/