CodeExplorer _prepare_term example
$requested_fields =
array_intersect_key( $post_fields,
array_flip( $fields ) );
$_post =
array_merge( $_post,
$requested_fields );
} $all_taxonomy_fields =
in_array( 'taxonomies',
$fields, true
);
if ( $all_taxonomy_fields ||
in_array( 'terms',
$fields, true
) ) { $post_type_taxonomies =
get_object_taxonomies( $post['post_type'
], 'names'
);
$terms =
wp_get_object_terms( $post['ID'
],
$post_type_taxonomies );
$_post['terms'
] = array
();
foreach ( $terms as $term ) { $_post['terms'
][] =
$this->
_prepare_term( $term );
} } if ( in_array( 'custom_fields',
$fields, true
) ) { $_post['custom_fields'
] =
$this->
get_custom_fields( $post['ID'
] );
} if ( in_array( 'enclosure',
$fields, true
) ) { $_post['enclosure'
] = array
();
$enclosures =
(array) get_post_meta( $post['ID'
], 'enclosure'
);
if ( !
empty( $enclosures ) ) {