WPSEO_Meta_Columns::posts_filter_dropdown_readability
Adds a dropdown that allows filtering on the posts Readability Quality.
Метод класса: WPSEO_Meta_Columns{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WPSEO_Meta_Columns = new WPSEO_Meta_Columns(); $WPSEO_Meta_Columns->posts_filter_dropdown_readability();
Код WPSEO_Meta_Columns::posts_filter_dropdown_readability() WPSEO Meta Columns::posts filter dropdown readability Yoast 27.8
public function posts_filter_dropdown_readability() {
if ( ! $this->can_display_filter() ) {
return;
}
$ranks = WPSEO_Rank::get_all_readability_ranks();
/* translators: Hidden accessibility text. */
echo '<label class="screen-reader-text" for="wpseo-readability-filter">' . esc_html__( 'Filter by Readability Score', 'wordpress-seo' ) . '</label>';
echo '<select name="readability_filter" id="wpseo-readability-filter">';
// phpcs:ignore WordPress.Security.EscapeOutput -- Output is correctly escaped in the generate_option() method.
echo $this->generate_option( '', __( 'All Readability Scores', 'wordpress-seo' ) );
foreach ( $ranks as $rank ) {
$selected = selected( $this->get_current_readability_filter(), $rank->get_rank(), false );
// phpcs:ignore WordPress.Security.EscapeOutput -- Output is correctly escaped in the generate_option() method.
echo $this->generate_option( $rank->get_rank(), $rank->get_drop_down_readability_labels(), $selected );
}
echo '</select>';
}