-1

we are having a performance issue for it we need to customize the calling of methods $get_posts methods in main post single page but we can't find where does it's code located we want to overwrite the $q['fields'] array in this part

switch ( $q['fields'] ) {
    case 'ids':
    $fields = "$wpdb->posts.ID";
    break;
    case 'id=>parent':
    $fields = "$wpdb->posts.ID, $wpdb->posts.post_parent";
    break;
    default:
    $fields = "$wpdb->posts.ID,$wpdb->posts.post_date,$wpdb->posts.post_title,$wpdb->posts.post_status,$wpdb->posts.post_name,$wpdb->posts.post_parent,$wpdb->posts.guid,$wpdb->posts.menu_order,$wpdb->posts.post_type,$wpdb->posts.post_mime_type";
} 
Cœur
  • 37,241
  • 25
  • 195
  • 267
Miroo
  • 795
  • 3
  • 13
  • 35

2 Answers2

0

Why you want to change that? I can't really see why that would solve your performance issue. It probably is somewhere else and I'm curious why you think fields will solve it.

However you can control the $fields by using the filter 'posts_fields'.

Marko Heijnen
  • 56
  • 2
  • 8
0

I honestly don't see where the content part of the post is being called in that array, I scanned the Wordpress Codex and don't see it either. Sorry, if I ran into this I would get a new theme myself.

  • This should really have been a comment - earn some more reputation point on StackOverflow and you've able to post them. – marko Nov 18 '12 at 18:12