posts_fields filter-hookWP 2.1.0

Filters the SELECT clause of the query.

Usage

add_filter( 'posts_fields', 'wp_kama_posts_fields_filter' );

/**
 * Function for `posts_fields` filter-hook.
 * 
 * @param string $fields The SELECT clause of the query.
 *
 * @return string
 */
function wp_kama_posts_fields_filter( $fields ){

	// filter...
	return $fields;
}
$fields(string)
The SELECT clause of the query.

Changelog

Since 2.1.0 Introduced.

Where the hook is called

WP_Query::get_posts()
posts_fields
wp-includes/class-wp-query.php 2927
$fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );

Where the hook is used in WordPress

Usage not found.