Home Add custom meta field to ACF gallery rest API
Reply: 0

Add custom meta field to ACF gallery rest API

BrownBe
1#
BrownBe Published in 2017-12-07 11:51:11Z

I get a dominante_color_hex field i registred like meta field. For each media, the rest API return the value expected from http://localhost:8888/wp-json/wp/v2/media :

"meta": {
   "dominant_color_hex": "#b5b2b9"
},

Now, with acf-to-rest-api plugin I looking forward to get this value on ACF gallery meta field from http://localhost:8888/wp-json/acf/v3/pages/4/gallery

This Json look like this :

"gallery": [
{
   "ID": 173,
   "id": 173,
   "title": "03",
   "filename": "03.jpg",
   "width": 1000,
   "height": 750,
   // here I need to display the dominante color hex
   "sizes": {
   ...

I m not sure to get the logic to achieve this. Any suggestions ?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.324002 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO