您可以通过向页面加载添加挂钩来添加自定义帮助,例如:。page-new.php
将成为load-page-new.php
function custom_help_page() {
add_filter(\'contextual_help\',\'custom_page_help\');
}
function custom_page_help($help) {
$custom = "<h5>Custom Help</h5>
<p>Custom help content</p>";
return $custom.$help;
}
add_action(\'load-page-new.php\',\'custom_help_page\'); //New page
add_action(\'load-page.php\',\'custom_help_page\'); //Page, edits, updates etc.
如果不希望仍显示默认帮助,只需删除
echo $help;
编辑为返回而不是回显值。