WPSEO_Meta_Columns::collect_filters()protectedYoast 1.0

Collects the filters and merges them into a single array.

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

Возвращает

Массив. Array containing all the applicable filters.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->collect_filters();

Код WPSEO_Meta_Columns::collect_filters() Yoast 23.5

protected function collect_filters() {
	$active_filters = [];

	$seo_filter             = $this->get_current_seo_filter();
	$readability_filter     = $this->get_current_readability_filter();
	$current_keyword_filter = $this->get_current_keyword_filter();

	if ( $this->is_valid_filter( $seo_filter ) ) {
		$active_filters = array_merge(
			$active_filters,
			$this->determine_seo_filters( $seo_filter )
		);
	}

	if ( $this->is_valid_filter( $readability_filter ) ) {
		$active_filters = array_merge(
			$active_filters,
			$this->determine_readability_filters( $readability_filter )
		);
	}

	if ( $this->is_valid_filter( $current_keyword_filter ) ) {
		/**
		 * Adapt the meta query used to filter the post overview on keyphrase.
		 *
		 * @internal
		 *
		 * @param array $keyphrase      The keyphrase used in the filter.
		 * @param array $keyword_filter The current keyword filter.
		 */
		$keyphrase_filter = apply_filters(
			'wpseo_change_keyphrase_filter_in_request',
			$this->get_keyword_filter( $current_keyword_filter ),
			$current_keyword_filter
		);

		if ( is_array( $keyphrase_filter ) ) {
			$active_filters = array_merge(
				$active_filters,
				[ $keyphrase_filter ]
			);
		}
	}

	/**
	 * Adapt the active applicable filters on the posts overview.
	 *
	 * @internal
	 *
	 * @param array $active_filters The current applicable filters.
	 */
	return apply_filters( 'wpseo_change_applicable_filters', $active_filters );
}