| 2916 | if ( 'author_ids' == $q['fields'] ) { |
| 2917 | if ( null === $this->posts ) { |
| 2918 | $this->posts = $wpdb->get_results( $this->request ); |
| 2919 | } |
| 2920 | |
| 2921 | $this->post_count = count( $this->posts ); |
| 2922 | $this->set_found_posts( $q, $limits ); |
| 2923 | |
| 2924 | $r = array(); |
| 2925 | foreach ( $this->posts as $key => $post ) { |
| 2926 | $this->posts[ $key ]->ID = (int) $post->ID; |
| 2927 | $this->posts[ $key ]->post_author = (int) $post->post_author; |
| 2928 | |
| 2929 | $r[ (int) $post->ID ] = (int) $post->post_author; |
| 2930 | } |
| 2931 | |
| 2932 | return $r; |
| 2933 | } |
| 2934 | |
| 2935 | if ( 'titles' == $q['fields'] ) { |
| 2936 | if ( null === $this->posts ) { |
| 2937 | $this->posts = $wpdb->get_results( $this->request ); |
| 2938 | } |
| 2939 | |
| 2940 | $this->post_count = count( $this->posts ); |
| 2941 | $this->set_found_posts( $q, $limits ); |
| 2942 | |
| 2943 | $r = array(); |
| 2944 | foreach ( $this->posts as $key => $post ) { |
| 2945 | $this->posts[ $key ]->ID = (int) $post->ID; |
| 2946 | $this->posts[ $key ]->post_title = sanitize_text_field( $post->post_title ); |
| 2947 | |
| 2948 | $r[ (int) $post->ID ] = sanitize_text_field( $post->post_title ); |
| 2949 | } |
| 2950 | |
| 2951 | return $r; |
| 2952 | } |
| 2953 | |