Meta Box
Support › General › Get select choicesResolved
Hello i created a simple select:
All is working good but how can i get list of possible choices from a page in php?
I tried print_r(rwmb_get_field_settings( 'cars' )) but seem to work only from services, not from pages.
Hello,
You can pass the post (service) ID to the third parameter to display the field settings anywhere on. your site. For example:
rwmb_get_field_settings( 'cars', '', 123 )
where 123 is the service ID.
Please read more on the documentation https://docs.metabox.io/functions/rwmb-get-field-settings/#arguments
Thanks very good, i noticed function rwmb_get_registry, can you make a example how to use it to get field 'cars' without address to services?
If you want to use the helper function rwmb_get_registry(), please check this example code:
rwmb_get_registry()
$meta_box_registry = rwmb_get_registry( 'meta_box' ); $meta_box = $meta_box_registry->get( 'field-group-id' ); echo "<pre>"; print_r ( $meta_box->meta_box['fields'] ); //print out the list of fields echo "</pre>";
Please read more on the documentation https://docs.metabox.io/functions/rwmb-get-registry/
ok great. Thanks and resolved!