函数原型
get_private_posts_cap_sql( string|array $post_type ): string
函数描述
Retrieves the private post SQL based on capability.
是否弃用
未弃用
函数参数
-
$post_type
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. |

