Maxinne
Maxinne

Reputation: 1693

wordpress json api and custom fields

I am using the Wordpress JSON API to get some posts for my app, and I need to get the image associated with the post. I used the Advanced Custom Fields to create the association in the form of a custom field.

Now the JSON API deliver only the image id, not it's URL. I was going to try to customize the json api and create the image object, but it is harder, and i don't know where to begin.

Any help will be appreciated.

How it is:

"custom_fields": {
    "fundo-slider": [
        "36"
    ],
    "frente-slider": [
        "37"
    ]
}

How I need:

"custom_fields": {
    "fundo-slider": [
        "http://url-to-image/image.jpg"
    ],
    "frente-slider": [
        "http://url-to-image/image.png"
    ]
}

Upvotes: 0

Views: 335

Answers (1)

Maxinne
Maxinne

Reputation: 1693

Ok, as nobody replied, I created a plug-in... Get it on github or wordpress.

Upvotes: 1

Related Questions