-
Hi,
I need to show Checkbox group list. Loop data will come from get_option().
I'm struggling to find out the solution how I can create such kind of settings.
https://prnt.sc/10wt7n3Posted 2 years ago # -
Hi,
If I understand right, you need this:
// config array array( 'id' => 'opt-checkbox-1', 'type' => 'checkbox', 'title' => 'Checkboxes', 'options' => 'prefix_get_something', // a custom function callback ),
CopyCopied!// your custom utils functions function prefix_get_something() { $somethings = get_option( 'somethings' ); // make array output like this: return array( 'opt-1' => 'Option 1', 'opt-2' => 'Option 2', 'opt-3' => 'Option 3', ); }
CopyCopied!This method can be used in radio, checkbox, select as well. ( See also: http://codestarframework.com/documentation/#/fields?id=checkbox Config Examples -> WP Query Options )
Regards, Codestar
Posted 2 years ago # -
Hi,
There's no reason to separate options with a callback function. I need to run a loop with index values.
Here's an example I've created by editing HTML: https://prnt.sc/10x1nne
Hope it help you to understand better.Thanks
Posted 2 years ago # -
I've made the solution myself.
Thanks a lotPosted 2 years ago # -
Well done
Posted 2 years ago #