WPSEO_Abstract_Post_Filter::add_filter_link()publicYoast 1.0

Adds a filter link to the views.

Метод класса: WPSEO_Abstract_Post_Filter{}

Хуков нет.

Возвращает

Массив<Строку,. string> Array of views including the added view.

Использование

$WPSEO_Abstract_Post_Filter = new WPSEO_Abstract_Post_Filter();
$WPSEO_Abstract_Post_Filter->add_filter_link( $views );
$views (обязательный)
-

Код WPSEO_Abstract_Post_Filter::add_filter_link() Yoast 23.6

public function add_filter_link( $views ) {
	$views[ 'yoast_' . $this->get_query_val() ] = sprintf(
		'<a href="%1$s"%2$s>%3$s</a> (%4$s)',
		esc_url( $this->get_filter_url() ),
		( $this->is_filter_active() ) ? ' class="current" aria-current="page"' : '',
		$this->get_label(),
		$this->get_post_total()
	);

	return $views;
}