function get_users_drafts( $user_id ) {}

Retrieve the user’s drafts.


  • int $user_id: User ID.

Defined filters

  • get_users_drafts
    apply_filters('get_users_drafts', $query)

Source code

function get_users_drafts( $user_id ) {

	global $wpdb;

	$query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id);

	$query = apply_filters('get_users_drafts', $query);

	return $wpdb->get_results( $query );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: