wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_private_posts_cap_sql › WordPress Function

Since2.2.0
已弃用n/a
get_private_posts_cap_sql ( $post_type )
参数:
  • (string|array) $post_type Single post type or an array of post types. Currently only supports 'post' or 'page'.
    Required: Yes
返回:
  • (string) SQL code that can be added to a where clause.
定义在:
文档:
Change Log:
  • 4.3.0

Retrieves 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.


源码

function get_private_posts_cap_sql( $post_type ) {
	return get_posts_by_author_sql( $post_type, false );
}