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:
  • 4: .

Description

Retrieves the post SQL based on capability, author, and type.

Related Functions

get_post_ancestors, get_the_author_icq, get_the_author_url, get_the_author_msn, get_post_embed_url

Top Google Results

User discussions

wpseek mobile