the_posts хук-фильтр . WP 1.5.0
Filters the array of retrieved posts after they've been fetched and internally processed.
Использование
add_filter( 'the_posts', 'filter_function_name_5405', 10, 2 ); function filter_function_name_5405( $posts, $this ){ // filter... return $posts; }
- $posts(WP_Post[])
- Array of post objects.
- $this(WP_Query)
- The WP_Query instance (passed by reference).
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
the_posts
wp-includes/class-wp-query.php 3190
$this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) );
Где используется хук в ядре WordPress
wp-includes/class-wp-query.php 256
add_filter( 'the_posts', '_close_comments_for_old_posts', 10, 2 );