Ticket #44510: user.2.diff
File user.2.diff, 533 bytes (added by , 6 years ago) |
---|
-
user.php
362 362 function count_user_posts( $userid, $post_type = 'post', $public_only = false ) { 363 363 global $wpdb; 364 364 365 if( $userid === NULL AND is_user_logged_in() ){ 366 $userid = get_current_user_id(); 367 } else { 368 return 0; 369 } 370 365 371 $where = get_posts_by_author_sql( $post_type, true, $userid, $public_only ); 366 372 367 373 $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" );