posts_selection WordPress Action Hook
The posts_selection hook is used to modify the SQL query that is used to fetch posts from the database. This hook is used to modify the query based on various conditions.
do_action( 'posts_selection', string $selection ) #
Fires to announce the query’s current selection parameters.
Description
For use by caching plugins.
Parameters
- $selection
(string)The assembled selection query.
More Information
This action hook is executed prior to the query and is passed a string containing the assembled query. Note that this string is NOT passed by reference and manipulating this string will not affect the actual query. This is intended to be used primarily by caching plugins.
Source
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |