Home › Forums › Backend Issues (wp-admin) › How to load Post Type fields with data from a remote API › Reply To: How to load Post Type fields with data from a remote API
I need to load the post Type with the data from the external URL, which brings a json with the data (fist code Sample of remote url(json))
My data is:
Comarca > Unidade > Setor
I need tó load a data from json URL to be selected in the Backend
`
{
“id”: 1,
“nome”: “Tribunal de Justiça do Estado do Acre”,
“sigla”: “TJAC”,
“comarcas”: [{
“id”: 2,
“nome”: “Acrelândia”,
“sigla”: “AL”,
“unidades”: [{
“id”: 24,
“nome”: “Direção do Foro”,
“sigla”: “ALDFO”,
“setor”: [{
“id”: 28,
“nome”: “Vara Cível”,
“sigla”: “ACVCI”,
“tipo”: “VARA”
},
{
“id”: 30,
“nome”: “Vara Criminal”,
“sigla”: “ACVCR”,
“tipo”: “VIRTUAL”
}
],
“tipo”: “ADMINISTRATIVA”,
]
}
[{
“id”: 2,
“nome”: “Rio Branco”,
“sigla”: “RB”,
“unidades”: [{
“id”: 24,
“nome”: “Direção do Foro”,
“sigla”: “ALDFO”,
“setor”: [{
“id”: 28,
“nome”: “Central de Execução de Penas e Medidas Alternativas”,
“sigla”: “BRCEPAL”,
“tipo”: “VARA”
},
{
“id”: 30,
“nome”: “Juizado Especial Criminal”,
“sigla”: “BRJECRIM”,
“tipo”: “VIRTUAL”
}
],
“tipo”: “ADMINISTRATIVA”
}]
}]
}
}
`
Field “sertor” => receive [nome] after selecting [comarca] and [unidade]
Field “sigla” => receive [sigla]
I’m researching an implementation model that makes this possible.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.