WordPress.org

Forums

JSON API
Displaying JSON Custom Fields (2 posts)

  1. smartdept
    Member
    Posted 2 years ago #

    Hi there,

    I'm using Sencha Architect and I'm trying to get the custom field values from this JSON response created with the WordPress JSON API: http://theojai.net/?json=get_recent_...pcf-deal-rules

    I've created a model, but I'm just not sure what to type in the "Mapping" fields for each of those custom_fields in the JSON response. Any thoughts?

    Here is my Sencha model. What do I put in the mapping areas for the last three?:

    Ext.define('Ojai.model.Deal', {
    extend: 'Ext.data.Model',
    
    config: {
        fields: [
            {
                name: 'Title',
                mapping: 'title'
            },
            {
                name: 'Business',
                mapping: 'custom_fields.wpcf-deal-business-owner'
            },
            {
                name: 'Expiry',
                mapping: 'wpcf-deal-expiry'
            },
            {
                name: 'Terms',
                mapping: 'wpcf-deal-rules'
            }
        ]
    }
    });

    http://wordpress.org/extend/plugins/json-api/

  2. WhiteAce
    Member
    Posted 2 years ago #

    Need this feature also, hope it can be done. [RESOLVED]
    Never mind - I've just found out that it is also in the JSON data - I Use "Types" to control over the custom fields - so the JSON Display: "wpcf-FIELD_NAME":["FIELD_DATA"].
    thanks, love this plugin :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • JSON API
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic