Ticket #25534: get_current_user_id.diff
| File get_current_user_id.diff, 709 bytes (added by , 13 years ago) |
|---|
-
wp-includes/query.php
2758 2758 if ( is_user_logged_in() ) { 2759 2759 // Add private states that are limited to viewing by the author of a post or someone who has caps to read private states. 2760 2760 $private_states = get_post_stati( array('private' => true) ); 2761 $user_id = get_current_user_id(); 2761 2762 foreach ( (array) $private_states as $state ) 2762 2763 $where .= current_user_can( $read_private_cap ) ? " OR $wpdb->posts.post_status = '$state'" : " OR $wpdb->posts.post_author = $user_id AND $wpdb->posts.post_status = '$state'"; 2763 2764 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)