Ticket #44510: 44510.diff
File 44510.diff, 487 bytes (added by , 7 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 return 0; 367 } 368 365 369 $where = get_posts_by_author_sql( $post_type, true, $userid, $public_only ); 366 370 367 371 $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" );