Adding custom fields to the JSON feed
-
Hi,
Thanks for a great plugin.
I’ve added custom fields to the JSON template in 1.0.9. Would be great if you could incorporate in the next release.
This snippet goes in template/feed-json.php just above the line $json[] = $single;
$custom_field_keys = get_post_custom_keys();
foreach ( $custom_field_keys as $key => $value ) {
$valuet = trim($value);
if ( '_' == $valuet{0} )
continue;
$single[$value] = get_post_meta($id, $value, true);
}
The topic ‘Adding custom fields to the JSON feed’ is closed to new replies.