Forum Replies Created

Viewing 1 replies (of 1 total)
  • I’m not using Pods.

    None of this worked for me.

    I also tried setting “feature_image” to an image post id, nothing.

    Then I inspected an object returned from /wp-json/wp/v2/posts/<id> and noticed a “featured_media”: “0” in the json, so I tried setting that value to an image post id and it worked.
    so my POST looks like this:

    {
                    method: "POST",
                    url: "https://<domain>/wp-json/wp/v2/posts" ,
                    headers: { 'Authorization' : 'Basic ' + $scope.au },
                    data: {
                    title: $scope.postData.title,
                    content: $scope.postData.content,
                    status: $scope.postData.status,
                    featured_media: $scope.imageid,
                    post_meta: [
                        {
                            "key": "_thumbnail_id",
                            "value":  $scope.imageid
                        }]
                 }

    I’m still working on getting oAuth1.0a to work correctly, so I’m using Basic Authentication for development.

Viewing 1 replies (of 1 total)