I am trying to get a list of array options and insert this list in a params value, The below is an example of what the output should be. I am using wordpress and say I wanted the array to be a list of all pages or user roles. Where I have the Engineer & FM role this will need to be a dynamic list based on the user roles available in wordpress.
array(
"type" => "dropdown",
"holder" => "div",
"class" => "",
"heading" => __( "Select the type of user", "my-text-domain" ),
"param_name" => "type",
"group" => __( 'User', 'my-text-domain' ),
"value" => array(
'engineer' => 'engineer',
'fm' => 'fm'),
'save_always' => true,
"description" => __( "Pick a dropdown option.", "my-text-domain" )
),
As above I want to insert a list of arrays here ( my_array_values ) but they will be dynamic so need to know how to insert the returned into the below as the format above is outputted?
array(
"type" => "dropdown",
"holder" => "div",
"class" => "",
"heading" => __( "Select the type of user", "my-text-domain" ),
"param_name" => "type",
"group" => __( 'User', 'my-text-domain' ),
"value" => array(
my_array_values),
'save_always' => true,
"description" => __( "Pick a dropdown option.", "my-text-domain" )
),