WordPress.org

Ready to get started?Download WordPress

Forums

Feed JSON
Adding custom fields to the JSON feed (1 post)

  1. tstephenson
    Member
    Posted 7 months ago #

    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);
    }

    https://wordpress.org/plugins/feed-json/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.