I need to output information about each of my post categories in this array, but I'm having trouble figuring out how.
I need to output each category as an array (See examples) under the values
option with the following information;
'label' => 'CATEGORY NAME'
'values' => 'CATEGORY ID'
array(
'param_name' => 'ids',
'settings' => array(
'multiple' => true,
'values' => array(
// EXAMPLE
array( 'label' => 'Abrams', 'value' => 1, 'group' => 'category' ),
// EXAMPLE
array( 'label' => 'Brama', 'value' => 2, 'group' => 'category' )
),
),
),
I've tried using a foreach
get_categories()
loop inside the array but apparently PHP doesn't like that.
Any help would be greatly appreciated.
array( 'label' => '[CATEGORY NAME]', 'value' => [CATEGORY ID], 'group' => 'category' )