/** * 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>'; }
/** * @param WPSEO_Option_Tabs $option_tabs Option Tabs to get tabs from. * @param Yoast_Form $yform Yoast Form which is being used in the views. * @param array $options Options which are being used in the views. */ public function run(WPSEO_Option_Tabs $option_tabs, Yoast_Form $yform, $options = array()) { echo '<h2 class="nav-tab-wrapper" id="wpseo-tabs">'; foreach ($option_tabs->get_tabs() as $tab) { printf('<a class="nav-tab" id="%1$s-tab" href="#top#%1$s">%2$s</a>', $tab->get_name(), $tab->get_label()); } echo '</h2>'; foreach ($option_tabs->get_tabs() as $tab) { // Prepare the help center for each tab. $help_center = new WPSEO_Help_Center($option_tabs->get_base(), $tab); $identifier = $tab->get_name(); printf('<div id="%s" class="wpseotab">', $identifier); // Output the help center. $help_center->output_help_center(); // Output the settings view for all tabs. $tab_view = $this->get_tab_view($option_tabs, $tab); if (is_file($tab_view)) { require_once $tab_view; } echo '</div>'; } }
echo $tab['label']; ?> </a> <?php } ?> <?php /** * Allow adding a custom import tab header */ do_action('wpseo_import_tab_header'); ?> </h2> <?php foreach ($tabs as $identifier => $tab) { printf('<div id="%s" class="wpseotab">', $identifier); if (!empty($tab['screencast_video_url'])) { $tab_video_url = $tab['screencast_video_url']; $helpcenter_tab = new WPSEO_Option_Tab($identifier, $tab['label'], array('video_url' => $tab['screencast_video_url'])); $helpcenter = new WPSEO_Help_Center($identifier, $helpcenter_tab); $helpcenter->output_help_center(); } require_once WPSEO_PATH . 'admin/views/tabs/tool/' . $identifier . '.php'; echo '</div>'; } /** * Allow adding a custom import tab */ do_action('wpseo_import_tab_content');
/** * Output the meta box */ public function meta_box() { $content_sections = $this->get_content_sections(); $helpcenter_tab = new WPSEO_Option_Tab('metabox', 'Meta box', array('video_url' => 'https://yoa.st/metabox-screencast')); $helpcenter = new WPSEO_Help_Center('metabox', $helpcenter_tab); $helpcenter->output_help_center(); 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(); } }
/** * Outputs a help center. * * @param string $id The id for the tab. */ function render_help_center($id) { $helpcenter_tab = new WPSEO_Option_Tab('bulk-' . $id, 'Bulk editor', array('video_url' => 'https://yoa.st/screencast-tools-bulk-editor')); $helpcenter = new WPSEO_Help_Center('bulk-editor' . $id, $helpcenter_tab); $helpcenter->output_help_center(); }
<h2 class="nav-tab-wrapper" id="wpseo-tabs"> <?php echo $platform_tabs = new WPSEO_GSC_Platform_Tabs(); ?> </h2> <?php // Video explains about the options when connected only. if (null !== $this->service->get_client()->getAccessToken()) { $video_url = 'https://yoa.st/screencast-search-console'; } else { $video_url = 'https://yoa.st/screencast-connect-search-console'; } $tab = new WPSEO_Option_Tab('GSC', __('Google Search Console'), array('video_url' => $video_url)); $GSCHelpCenter = new WPSEO_Help_Center('google-search-console', $tab); $GSCHelpCenter->output_help_center(); switch ($platform_tabs->current_tab()) { case 'settings': // Check if there is an access token. if (null === $this->service->get_client()->getAccessToken()) { // Print auth screen. echo '<p>'; /* Translators: %1$s: expands to 'Yoast SEO', %2$s expands to Google Search Console. */ echo sprintf(__('To allow %1$s to fetch your %2$s information, please enter your Google Authorization Code. Clicking the button below will open a new window.', 'wordpress-seo'), 'Yoast SEO', 'Google Search Console'); echo "</p>\n"; echo '<input type="hidden" id="gsc_auth_url" value="', $this->service->get_client()->createAuthUrl(), '" />'; echo "<button type='button' id='gsc_auth_code' class='button'>", __('Get Google Authorization Code', 'wordpress-seo'), "</button>\n"; echo '<p id="gsc-enter-code-label">' . __('Enter your Google Authorization Code and press the Authenticate button.', 'wordpress-seo') . "</p>\n"; echo "<form action='" . admin_url('admin.php?page=wpseo_search_console&tab=settings') . "' method='post'>\n"; echo "<input type='text' name='gsc[authorization_code]' value='' class='textinput' aria-labelledby='gsc-enter-code-label' />"; echo "<input type='hidden' name='gsc[gsc_nonce]' value='" . wp_create_nonce('wpseo-gsc_nonce') . "' />";