get_posts_by_author_sql
get_posts_by_author_sql ( $post_type, $full = true, $post_author = null, $public_only = false )
Parameters:- (string|string[]) post_type Single post type or an array of post types.
- (bool) full Optional. Returns a full WHERE statement instead of just an 'andalso' term. Default true.
- (int) post_author Optional. Query posts having a single author ID. Default null.
- (bool) public_only Optional. Only return public posts. Skips cap checks for $current_user. Default false.
See:Returns:- (string) SQL WHERE code that can be added to a query.
Defined at:Change Log: - Introduced in WordPress: 3.0.0
- Deprecated in WordPress: —
Description
Retrieves the post SQL based on capability, author, and type.