set_help_sidebar($this->content('help/sidebar')); $screen->add_help_tab( array( 'id' => 'usage-plugin-help', 'title' => __('Usage', 'post-snippets'), 'content' => $this->content('help/usage') ) ); $screen->add_help_tab( array( 'id' => 'post-plugin-help', 'title' => __('Post Editor', 'post-snippets'), 'content' => $this->content('help/post') ) ); if (!defined('POST_SNIPPETS_DISABLE_PHP')) { $screen->add_help_tab( array( 'id' => 'php-plugin-help', 'title' => __('PHP', 'post-snippets'), 'content' => $this->content('help/php') ) ); } $screen->add_help_tab( array( 'id' => 'advanced-plugin-help', 'title' => __('Advanced', 'post-snippets'), 'content' => $this->content('help/advanced') ) ); $screen->add_help_tab( array( 'id' => 'filters-plugin-help', 'title' => __('Filters', 'post-snippets'), 'content' => $this->content('help/filters') ) ); $screen->add_help_tab( array( 'id' => 'restapi-plugin-help', 'title' => __('REST API', 'post-snippets'), 'content' => $this->content('help/restapi') ) ); $screen->add_help_tab( array( 'id' => 'gutenberg-plugin-help', 'title' => __('Gutenberg Block', 'post-snippets'), 'content' => $this->content('help/gutenberg') ) ); } /** * Setup the help tab for the post editor. * * @return void */ public function postEditorTabs() { $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'postsnippets-plugin-help', 'title' => 'Post Snippets', 'content' => $this->content('help/post') ) ); } /** * Get the content for a help tab * * @param string $tab * @return string */ private function content($tab) { return View::render($tab); } }