ID, $fieldName, true); $label = $field['label']; $description = $field['description']; $fieldHTML = ''; switch ($type) { case 'textbox': $fieldHTML = ''; break; case 'textarea': $fieldHTML = ''; break; case 'checkbox': $extraText = $field['extraText'] ? $field['extraText'] : ''; $fieldHTML = ' '.$extraText.''; break; case 'select': $customList = $field['oArr'] ? $field['oArr'] : array('label' => '0', 'value' => 'Empty'); //lines into array $fieldHTML = ''; break; case 'posts': $customList = get_posts( array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'post_type' => 'post', 'post_status' => $post_status, ) ); //lines into array foreach ($customList as $post) { //comma separated string into array $selected = selected($post->ID, $fieldValue, false) ? selected($post->ID, $fieldValue, false) : ''; //set the options $fieldHTML .= ''; } break; } // //END of select types switch // $fieldHTML .= ''; break; case 'datepicker': $fieldHTML = ''; break; case 'timepicker': $fieldHTML = ''; break; case 'colorpicker': $fieldHTML = ''; break; case 'radio': // var_dump($field); // exit; if (isset($field['radioType']) && $field['radioType'] === 'custom') { $fieldHTML = ''; foreach ($field['oArr'] as $radio) { $radioValue = ''; if(isset($radio->value)){ $radioValue = $radio->value; } $radioLabel = ''; if(isset($radio->label)){ $radioLabel = $radio->label; } $tempChecked = checked($radioValue, $fieldValue, false); $checked = $tempChecked ? $tempChecked : ''; $fieldHTML .= ' '.$radioLabel.' '; if ($field['orientation'] === 'v') { //add new line if orientation is set to vertical $fieldHTML .= '
'; } } } break; case 'upload': $buttonString = 'Upload'; if (!empty($fieldValue)) { $buttonString = 'Remove'; } $fieldHTML .= '

'; $fieldHTML .= ''; $fieldHTML .= 'Uploaded image for '.$field['label'].''; break; } ?>