posts_selection

Fires to announce the query's current selection parameters.

Description

do_action( 'posts_selection', (string) $where_groupby_orderby_limits_join ); 

For use by caching plugins.

Parameters (1)

0. $where_groupby_orderby_limits_join (string)
The where groupby orderby limits join.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'posts_selection', $where_groupby_orderby_limits_join ); 
The following example is for adding a hook callback.
  1. // define the posts_selection callback 
  2. function action_posts_selection( $where_groupby_orderby_limits_join ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'posts_selection', 'action_posts_selection', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'posts_selection', 'action_posts_selection', 10, 1 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/class-wp-query.php  
  1. do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );