WPSEO_Help_Center::output_help_center PHP Method

output_help_center() public method

Outputs the help center.
public output_help_center ( )
    public function output_help_center()
    {
        $help_center_items = apply_filters('wpseo_help_center_items', $this->help_center_items);
        $help_center_items = array_filter($help_center_items, array($this, 'is_a_help_center_item'));
        if (empty($help_center_items)) {
            return;
        }
        $id = sprintf('tab-help-center-%s-%s', $this->group_name, $this->tab->get_name());
        ?>
		<div class="wpseo-tab-video-container">
			<button type="button" class="wpseo-tab-video-container__handle" aria-controls="<?php 
        echo $id;
        ?>
"
			        aria-expanded="false">
					<span
						class="dashicons-before dashicons-editor-help"><?php 
        _e('Help center', 'wordpress-seo');
        ?>
</span>
				<span class="dashicons dashicons-arrow-down toggle__arrow"></span>
			</button>
			<div id="<?php 
        echo $id;
        ?>
" class="wpseo-tab-video-slideout">
				<div class="yoast-help-center-tabs">
					<ul>
						<?php 
        $class = 'active wpseo-help-center-item';
        foreach ($help_center_items as $help_center_item) {
            $id = $help_center_item->get_identifier();
            $dashicon = $help_center_item->get_dashicon();
            if (!empty($dashicon)) {
                $dashicon = 'dashicons-before ' . $dashicon;
            }
            $link_id = "tab-link-{$this->group_name}_{$this->tab->get_name()}__{$id}";
            $panel_id = "tab-panel-{$this->group_name}_{$this->tab->get_name()}__{$id}";
            ?>

							<li id="<?php 
            echo esc_attr($link_id);
            ?>
" class="<?php 
            echo $class;
            ?>
">
								<a href="<?php 
            echo esc_url("#{$panel_id}");
            ?>
"
								   class="<?php 
            echo $id . ' ' . $dashicon;
            ?>
"
								   aria-controls="<?php 
            echo esc_attr($panel_id);
            ?>
"><?php 
            echo esc_html($help_center_item->get_label());
            ?>
</a>
							</li>
							<?php 
            $class = 'wpseo-help-center-item';
        }
        ?>
					</ul>
				</div>
				<div class="contextual-help-tabs-wrap">
					<?php 
        $classes = 'help-tab-content active';
        foreach ($help_center_items as $help_center_item) {
            $id = $help_center_item->get_identifier();
            $panel_id = "tab-panel-{$this->group_name}_{$this->tab->get_name()}__{$id}";
            ?>
						<div id="<?php 
            echo esc_attr($panel_id);
            ?>
" class="<?php 
            echo $classes;
            ?>
">
							<?php 
            echo $help_center_item->get_content();
            ?>
						</div>
						<?php 
            $classes = 'help-tab-content';
        }
        ?>
				</div>
			</div>
		</div>
		<?php 
    }

Usage Example

コード例 #1
0
 /**
  * Shows the Yoast SEO metabox for the term.
  */
 public function display()
 {
     $content_sections = $this->get_content_sections();
     $product_title = 'Yoast SEO';
     if (file_exists(WPSEO_PATH . 'premium/')) {
         $product_title .= ' Premium';
     }
     printf('<div id="wpseo_meta" class="postbox yoast wpseo-taxonomy-metabox-postbox"><h2><span>%1$s</span></h2>', $product_title);
     echo '<div class="inside">';
     $helpcenter_tab = new WPSEO_Option_Tab('tax-metabox', 'Meta box', array('video_url' => 'https://yoa.st/metabox-taxonomy-screencast'));
     $helpcenter = new WPSEO_Help_Center('tax-metabox', $helpcenter_tab);
     $helpcenter->output_help_center();
     echo '<div id="taxonomy_overall"></div>';
     if (!defined('WPSEO_PREMIUM_FILE')) {
         echo $this->get_buy_premium_link();
     }
     echo '<div class="wpseo-metabox-sidebar"><ul>';
     foreach ($content_sections as $content_section) {
         if ($content_section->name === 'premium') {
             continue;
         }
         $content_section->display_link();
     }
     echo '</ul></div>';
     foreach ($content_sections as $content_section) {
         $content_section->display_content();
     }
     echo '</div></div>';
 }
All Usage Examples Of WPSEO_Help_Center::output_help_center