php - WordPress 编辑管理员帮助选项卡

标签 php wordpress

编辑:为了清楚起见,我只是添加了我要编辑的部分的屏幕截图: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 );
}

<罢工>


编辑:

要更改帮助选项卡,可以这样做:

Add “Help” Tab to One or All Dashboard Screens

关于php - WordPress 编辑管理员帮助选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33083872/

相关文章:

php - mysqli_fetch_assoc()需要参数/调用成员函数bind_param()错误。如何获取并修复实际的mysql错误?

php - 升级到 PHP 7 后如何在 CentOS 上安装 mbstring

css - Wordpress 子菜单被切断

html - 如何在联系表 7 中设置接受标签的样式?

php - Wordpress 二十十二全屏响应式背景图片

javascript - Recaptcha 请求在引导模式弹出窗口中超时

php - 对 php/MySQL 搜索结果进行排序

php - str_replace 和大写或小写

php - ob_flush 需要很长时间才能执行

php - wordpress Wp_query 和日期字段的元查询问题