Skip to content
Christiaan Conover edited this page Apr 11, 2016 · 1 revision

Starting in version 0.8.3, the plugin has support for the WordPress REST API.

When the WP REST API codebase is available, this plugin registers the caption fields with the posts endpoints to add these fields to the response for each post. This data is made available under the cc_featured_image_caption property inside each post object.

The cc_featured_image_caption property is an object, containing properties for each of the featured image caption input fields:

  • caption_text
  • source_text
  • source_url

Each of these properties contains the value of the field, and if the field is empty the value is false.

Examples

Here is a sample response with all of the caption fields filled in:

"cc_featured_image_caption": {
  "caption_text": "Sample caption text.",
  "source_text": "Sample attribution text",
  "source_url": "http://example.com"
}

Here is a sample response with none of the caption fields filled in:

"cc_featured_image_caption": {
  "caption_text": false,
  "source_text": false,
  "source_url": false
}
Clone this wiki locally