wordpress下拉菜单
Each WordPress admin screen has a Help button. This area drop downs and contains text that helps the user understand the features of the specific page. When creating a custom site for your clients or a plugin, then you may find a need to modify the Help Dropdown text. In this article, we will show you how to modify the help dropdown text in WordPress admin area.
每个WordPress管理屏幕都有一个“帮助”按钮。 该区域下拉菜单中包含帮助用户理解特定页面功能的文本。 在为客户或插件创建自定义站点时,可能会发现需要修改“帮助”下拉菜单文本。 在本文中,我们将向您展示如何在WordPress管理区域中修改帮助下拉文本。
First open your theme’s functions.php file and paste the following code:
首先打开主题的functions.php文件,然后粘贴以下代码:
add_action('load-page-new.php','custom_help_page');
add_action('load-page.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>";
}
This code above will add custom help text on every Add New Page screen. You can do this for your posts page, or any other screen. This is something that we will be utilizing for our plugins that we have intentions of creating.
上面的代码将在每个“添加新页面”屏幕上添加自定义帮助文本。 您可以在帖子页面或任何其他屏幕上执行此操作。 这是我们将要用于打算创建的插件的东西。
Source: Sixrevisions Blog
资料来源: Sixrevisions博客
wordpress下拉菜单