/** * Returns the metabox section for the social settings. * * @return WPSEO_Metabox_Section */ private function get_social_meta_section() { $options = WPSEO_Options::get_option('wpseo_social'); $taxonomy_social_fields = new WPSEO_Taxonomy_Social_Fields($this->term); $tabs = array(); if ($options['opengraph'] === true) { $facebook_meta_fields = $taxonomy_social_fields->get_by_network('opengraph'); $tabs[] = new WPSEO_Metabox_Form_Tab('facebook', $this->taxonomy_tab_content->html($facebook_meta_fields), '<span class="dashicons dashicons-facebook-alt"></span>', array('link_title' => __('Facebook / Opengraph metadata', 'wordpress-seo'))); } if ($options['twitter'] === true) { $twitter_meta_fields = $taxonomy_social_fields->get_by_network('twitter'); $tabs[] = new WPSEO_Metabox_Form_Tab('twitter', $this->taxonomy_tab_content->html($twitter_meta_fields), '<span class="dashicons dashicons-twitter"></span>', array('link_title' => __('Twitter metadata', 'wordpress-seo'))); } return new WPSEO_Metabox_Tab_Section('social', '<span class="dashicons dashicons-share"></span>', $tabs, array('link_title' => __('Social', 'wordpress-seo'))); }
/** * Returns the metabox section for the social settings. * * @return WPSEO_Metabox_Section */ private function get_social_meta_section() { $options = WPSEO_Options::get_option('wpseo_social'); $taxonomy_social_fields = new WPSEO_Taxonomy_Social_Fields($this->term); $tabs = array(); $single = true; if ($options['opengraph'] === true && $options['twitter'] === true) { $single = null; } if ($options['opengraph'] === true) { $facebook_meta_fields = $taxonomy_social_fields->get_by_network('opengraph'); $tabs[] = new WPSEO_Metabox_Form_Tab('facebook', $this->taxonomy_tab_content->html($facebook_meta_fields), '<span class="screen-reader-text">' . __('Facebook / Open Graph metadata', 'wordpress-seo') . '</span><span class="dashicons dashicons-facebook-alt"></span>', array('link_aria_label' => __('Facebook / Open Graph metadata', 'wordpress-seo'), 'link_class' => 'yoast-tooltip yoast-tooltip-se', 'single' => $single)); } if ($options['twitter'] === true) { $twitter_meta_fields = $taxonomy_social_fields->get_by_network('twitter'); $tabs[] = new WPSEO_Metabox_Form_Tab('twitter', $this->taxonomy_tab_content->html($twitter_meta_fields), '<span class="screen-reader-text">' . __('Twitter metadata', 'wordpress-seo') . '</span><span class="dashicons dashicons-twitter"></span>', array('link_aria_label' => __('Twitter metadata', 'wordpress-seo'), 'link_class' => 'yoast-tooltip yoast-tooltip-se', 'single' => $single)); } return new WPSEO_Metabox_Tab_Section('social', '<span class="screen-reader-text">' . __('Social', 'wordpress-seo') . '</span><span class="dashicons dashicons-share"></span>', $tabs, array('link_aria_label' => __('Social', 'wordpress-seo'), 'link_class' => 'yoast-tooltip yoast-tooltip-e')); }