Retrieves the private post SQL based on capability.
Description
This function provides a standardized way to appropriately select on the post_status of a post type. The function will return a piece of SQL code that can be added to a WHERE clause; this SQL is constructed to allow all published posts, and all private posts to which the user has access.
Parameters
$post_typestring|array
Single post type or an array of post types. Currently only supports 'post' or 'page'.
Signature, return type and hooks compared across 5 parsed releases.
4.3.0
Added the ability to pass an array to $post_type.from the docblock
2.2.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/post.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.