WordPress at a glance
function is not described

get_private_posts_cap_sql() WP 2.2.0

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.

  • Since 4.3.0 Added the ability to pass an array to $post_type.

No Hooks.

Return

String. SQL code that can be added to a where clause.

Usage

get_private_posts_cap_sql( $post_type );
$post_type(string/array) (required)
Single post type or an array of post types. Currently only supports 'post' or 'page'.

Code of get private posts cap sql: wp-includes/post.php VER 5.0.3

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