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

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – WordPress编辑管理员帮助选项卡脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
编辑:为了清晰起见,只需添加我要编辑的部分的屏幕截图: screenshot for clarity

我试图使用我自己的内容创建和修改屏幕右上角的wordpress后端帮助标签,我尝试使用codex但不确定我是否正在查看正确的引用,无论它是否工作或我没有正确实现它但即使在认使用状态下尝试使用它也没有任何变化.这是我使用的参考:[codex reference] [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编辑管理员帮助选项卡全部内容,希望文章能够帮你解决php – WordPress编辑管理员帮助选项卡所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。