Follow us on
  1. 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.

    Posted 2 years ago #

  2. Codestar


    If I understand right, you need this:

    // config array
      'id'      => 'opt-checkbox-1',
      'type'    => 'checkbox',
      'title'   => 'Checkboxes',
      'options' => 'prefix_get_something', // a custom function callback
    // 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',

    This method can be used in radio, checkbox, select as well. ( See also: Config Examples -> WP Query Options )

    Regards, Codestar

    Posted 2 years ago #
  3. 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:
    Hope it help you to understand better.


    Posted 2 years ago #
  4. I've made the solution myself.
    Thanks a lot

    Posted 2 years ago #

  5. Codestar

    Well done

    Posted 2 years ago #