get_private_posts_cap_sql( string|array $post_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.
参数
- $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 | 描述 |
---|---|
4.3.0 | Added the ability to pass an array to $post_type . |
2.2.0 | Introduced. |
相关函数
Uses
-
wp-includes/post.php:
get_posts_by_author_sql()
Used By
-
wp-includes/author-template.php:
wp_list_authors()
你可能对这些文章感兴趣:
- wordpress函数has_filter()用法示例
- wordpress函数has_meta()用法示例
- wordpress函数has_excerpt()用法示例
- wordpress函数has_header_video()用法示例
- wordpress函数has_category()用法示例
- wordpress函数has_custom_logo()用法示例
- wordpress函数has_custom_header()用法示例
- wordpress函数hash_hmac()用法示例
- wordpress函数grant_super_admin()用法示例
- wordpress函数get_the_post_thumbnail_url()用法示例
- wordpress函数hash_equals()用法示例
- wordpress函数got_url_rewrite()用法示例
- wordpress函数gzip_compression()用法示例
- wordpress函数got_mod_rewrite()用法示例
如有疑问,请前往问答中心反馈!
反馈