Uses
Uses | Description |
---|---|
wp-includes/post.php: get_posts_by_author_sql() | Retrieve the post SQL based on capability, author, and type. |
Retrieve the private post SQL based on capability.
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.
(string|array) (Required) Single post type or an array of post types. Currently only supports 'post' or 'page'.
(string) SQL code that can be added to a where clause.
File: wp-includes/post.php
function get_private_posts_cap_sql( $post_type ) { return get_posts_by_author_sql( $post_type, false ); }
Version | Description |
---|---|
4.3.0 | Added the ability to pass an array to $post_type . |
2.2.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_private_posts_cap_sql