get_posts_by_author_sql( array|string $post_type, bool $full = true, int $post_author = null, bool $public_only = false )

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

25 related functions found for: get_posts_by_author_sql

Top ↑

Related terms found for this post

wp-parser-related-wordsauthor, authors, get, post, post-php, posts, queri, query, sql, user, wp-includes
wp-parser-packagePost, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • author
  • authors
  • get
  • post
  • Post
  • post-php
  • posts
  • queri
  • query
  • sql
  • user
  • wp-includes
  • wp-includes/post.php

Top ↑

Description Description

Top ↑

Parameters Parameters


(array|string) (Required) Single post type or an array of post types.


(bool) (Optional) Returns a full WHERE statement instead of just an 'andalso' term.

Default value: true


(int) (Optional) Query posts having a single author ID.

Default value: null


(bool) (Optional) Only return public posts. Skips cap checks for $current_user.

Default value: false

Top ↑

Return Return

(string) SQL WHERE code that can be added to a query.

Top ↑

Source Source

File: wp-includes/post.php


Top ↑

Changelog Changelog

Version Description
4.3.0 Introduced the ability to pass an array of post types to $post_type.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.