Get Post

GET https://example.com/wp-json/dt-posts/v2/{post_type}/{post_id}/

Requires permission: access_{post_type}

Returns

(json object): the contact. Each field type will show in a different way:

  • "ID"

  • "name":"John Doe",

  • "created_date":"2018-06-05 16:07:16",

  • "last_modified":"1552987784", //date the contact has last been modified

  • text fields

"field_key": "text"
  • multi_select fields

    "field_key": [ 
      "option_key", 
      "option_key",
      ... 
    ]
  • key_select fields

    "field_key": {
     "key":"option_key",
     "label":"option_label"
    },
  • connection fields

    "field_key": [ 
     { 
         "ID":{post_id},
         "post_type":"{post_type}",
         "post_date_gmt":"2018-05-29 13:12:01",
         "post_date":"2018-05-29 13:12:01",
         "post_title":"{post_title}"
     },
     ...
    ]
  • date fields

    "field_key": {
      timestamp: "1552953600",  //unix timestamp and the date
      formatted: "March 19, 2019" // date formatted base on selected date format in WP settings
    }

Return Example

Last updated

Was this helpful?