Advertisements

get_users_drafts

Definition:
function get_users_drafts( $user_id ) {}

Retrieve the user’s drafts.

Parameters

  • 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 );

}

1885

Advertisements

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:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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: