Filter hook 'wp_search_stopwords'

in WP Core File wp-includes/class-wp-query.php at line 1615

View Source

wp_search_stopwords

Filter Hook
Description
Filters stopwords used when parsing search terms.

Hook Information

File Location wp-includes/class-wp-query.php View on GitHub
Hook Type Filter
Line Number 1615

Hook Parameters

Type Name Description
string[] $stopwords Array of stopwords.

Usage Examples

Basic Usage
<?php
// Hook into wp_search_stopwords
add_filter('wp_search_stopwords', 'my_custom_filter', 10, 1);

function my_custom_filter($stopwords) {
    // Your custom filtering logic here
    return $stopwords;
}

Source Code Context

wp-includes/class-wp-query.php:1615 - How this hook is used in WordPress core
<?php
1610  		 *
1611  		 * @since 3.7.0
1612  		 *
1613  		 * @param string[] $stopwords Array of stopwords.
1614  		 */
1615  		$this->stopwords = apply_filters( 'wp_search_stopwords', $stopwords );
1616  		return $this->stopwords;
1617  	}
1618  
1619  	/**
1620  	 * Generates SQL for the ORDER BY condition based on passed search terms.

PHP Documentation

<?php
/**
		 * Filters stopwords used when parsing search terms.
		 *
		 * @since 3.7.0
		 *
		 * @param string[] $stopwords Array of stopwords.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/class-wp-query.php
Related Hooks

Related hooks will be displayed here in future updates.