option a: use the amazon api to get the info.
option b: use php to scrape the info, and programatically insert into an ACF field.
came here exactly because of this problem. it is still not fixed, right?
i fixed this using a hack of putting the id/callbackurl in the post_id section since its always sent and i’m not using it.
Yes, that was it.
didn’t find nothing on https://www.advancedcustomfields.com/resources/checkbox/ and thought it was a regex that anything after the first “:” would be the label, never thought it would require a space 🙂
thanks!
came here for the same thing, for example:
this works:
while(have_rows($listaEventoskey,’option’)){
the_row();
$thisid = get_sub_field(‘eventid’);
echo “i have this: $thisid<br>”;
}
but, this won’t work:
function infoEvento() {
while(have_rows($listaEventoskey,’option’)){
the_row();
$thisid = get_sub_field(‘eventid’);
echo “tenho o id de $thisid<br>”;
}
}
infoEvento();
I’ve tried to load the array outside of the acf_load and pass it inside and it works.
$teste =get_field('gerir_portfolio_modelos', $pageidselects );
add_filter('acf/load_field/key=field_5afbf7bb8380b', function( $field ){
global $teste;
(...)
foreach( $teste as $bundle ){ (...)
and it works as expected.
well this fixed it, but i would like to understand why did this happens,
Is this a know bug, or am i missing something?
I’ve tried group fields but with the same results, i even search for some tutorials but with no luck.
thanks.
my working code if anyone is interested:
//check select field from .json
add_filter('acf/load_field/key=field_5af2cece02f00', function( $field ){
// options of the choices to add to select
$field['choices'] = array();
// dynamic data we want to populate with
$bundles = get_field('gerir_marcas', 'option' );
//$portfolio = get_field('item_portfolio','option');
//var_dump($bundles);
foreach( $bundles as $bundle ){
$field['choices'][$bundle['marca']] = $bundle['marca'];
}
// All done!
return $field;
} );
awesome!
on 2) can i use the options page as a $post_id ? or i need to have a post with a custom field to be able to save it to my DB?
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.