I'm trying to build a PHP function that creates a drop down inside an array. The theme I'm using gave me an example on how to add custom data to fields and I'm trying to then modify that to add a drop down menu. I'm not even sure if it's possible. The code I have creates the drop down box but doesn't have any data in it.
Here is my code:
function frontend_add_timezone_field( $fields ) {
$fields['job']['timezone'] = array(
'label' => __( 'Your Timezone', 'job_manager' ),
timezone => array('(GMT-10:00) Hawaii', '(GMT-09:00) Alaska', '(GMT-08:00) Pacific Time (US & Canada)' ),
'priority' => 7
);
echo '<select name="timezon">';
for($i = 0; $i < count($timezone);$i++)
{
echo '<option value="'. ($i + 1) .'">' .$timezone{$i} . '</option>';
}
echo '</select>';
}
Any tips would be greatly appreciated, thanks!