本文整理汇总了PHP中WP_Screen::get_help_sidebar方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Screen::get_help_sidebar方法的具体用法?PHP WP_Screen::get_help_sidebar怎么用?PHP WP_Screen::get_help_sidebar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Screen
的用法示例。
在下文中一共展示了WP_Screen::get_help_sidebar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Used this method to add tab and sidebar to the screen
*
* @brief Display
*/
public function display()
{
// Merging
$this->tabs = array_merge($this->tabs, (array) $this->tabs());
// Add the tabs
foreach ($this->tabs as $title => $callable_content) {
$this->addTab($title, $callable_content);
}
// Add the sidebar if exists
$sidebar = $this->sidebar();
if (!empty($sidebar)) {
$current = $this->currentScreen->get_help_sidebar();
$this->currentScreen->set_help_sidebar($current . $sidebar);
}
}
示例2: applySidebar
/**
* Applies the new sidebar contents based on loaded files.
*
* This should be called during WordPress's `admin_head` hook.
*
* @link https://developer.wordpress.org/reference/hooks/admin_head/
*
* @uses Parsedown::text()
* @uses WP_Screen::get_help_sidebar()
* @uses WP_Screen::set_help_sidebar()
*
* @return @void
*/
public function applySidebar()
{
foreach ($this->_sidebar_files as $file) {
if (is_readable($file)) {
$this->_screen->set_help_sidebar($this->_screen->get_help_sidebar() . $this->get_parsedown()->text(file_get_contents($file)));
}
}
}