/**
  * Set the SEO scores belonging to their SEO score result
  *
  * @return array
  */
 private function get_seo_scores_with_post_count()
 {
     $ranks = WPSEO_Rank::get_all_ranks();
     return array_map(array($this, 'map_rank_to_widget'), $ranks);
 }
Esempio n. 2
0
    /**
     * Adds a dropdown that allows filtering on the posts SEO Quality.
     *
     * @return void
     */
    public function posts_filter_dropdown()
    {
        if ($GLOBALS['pagenow'] === 'upload.php' || $this->is_metabox_hidden() === true) {
            return;
        }
        $ranks = WPSEO_Rank::get_all_ranks();
        $current_seo_filter = filter_input(INPUT_GET, 'seo_filter');
        echo '
			<label class="screen-reader-text" for="wpseo-filter">' . __('Filter by SEO Score', 'wordpress-seo') . '</label>
			<select name="seo_filter" id="wpseo-filter">
				<option value="">', __('All SEO Scores', 'wordpress-seo'), '</option>';
        foreach ($ranks as $rank) {
            $sel = selected($current_seo_filter, $rank->get_rank(), false);
            echo '
				<option ', $sel, 'value="', $rank->get_rank(), '">', $rank->get_drop_down_label(), '</option>';
        }
        echo '
			</select>';
    }