WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Query::parse_search_terms() protected WP 3.7.0

Check if the terms are suitable for searching.

Uses an array of stopwords (terms) that are excluded from the separate term matching when searching for posts. The list of English stopwords is the approximate search engines list, and is translatable.

Это метод класса: WP_Query{}

Хуков нет.

Возвращает

Строку[]. Terms that are not stopwords.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->parse_search_terms( $terms );
$terms(строка[]) (обязательный)
Array of terms to check.

Список изменений

С версии 3.7.0 Введена.

Код WP_Query::parse_search_terms() WP 5.5.1

wp-includes/class-wp-query.php
<?php
protected function parse_search_terms( $terms ) {
	$strtolower = function_exists( 'mb_strtolower' ) ? 'mb_strtolower' : 'strtolower';
	$checked    = array();

	$stopwords = $this->get_search_stopwords();

	foreach ( $terms as $term ) {
		// Keep before/after spaces when term is for exact match.
		if ( preg_match( '/^".+"$/', $term ) ) {
			$term = trim( $term, "\"'" );
		} else {
			$term = trim( $term, "\"' " );
		}

		// Avoid single A-Z and single dashes.
		if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\-]$/i', $term ) ) ) {
			continue;
		}

		if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) ) {
			continue;
		}

		$checked[] = $term;
	}

	return $checked;
}