Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_users_drafts [ WordPress Function ]

get_users_drafts ( $user_id )
Parameters:
  • (int) $user_id User ID.
Returns:
  • (array)
Defined at:



Retrieve the user's drafts.

Source


<?php
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 );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics