Skip to content

Instantly share code, notes, and snippets.

@dovy
Created February 9, 2014 06:11
Show Gist options
  • Save dovy/8895048 to your computer and use it in GitHub Desktop.
Save dovy/8895048 to your computer and use it in GitHub Desktop.
echo '<tr><td>';
// If field has class set, add it
if (isset($field['class'])) {
$field['class'] .= " group";
} else {
$field['class'] = " group";
}
// If field has a title, set it
if (!empty($field['title'])) {
echo '<h4>' . $field['title'] . '</h4>';
}
// If field has a subtitle, set it
if (!empty($field['subtitle'])) {
echo '<span class="description">' . $field['subtitle'] . '</span>';
}
echo '<tr>';
// If field has class set, add it
if (isset($field['class'])) {
$field['class'] .= " group";
} else {
$field['class'] = " group";
}
$th = "";
if( isset( $field['title'] ) && isset( $field['type'] ) && $field['type'] !== "info" && $field['type'] !== "section" ) {
$default_mark = ( !empty($field['default']) && isset($this->options[$field['id']]) && $this->options[$field['id']] == $field['default'] && !empty( $this->args['default_mark'] ) && isset( $field['default'] ) ) ? $this->args['default_mark'] : '';
if (!empty($field['title'])) {
$th = $field['title'] . $default_mark."";
}
if( isset( $field['subtitle'] ) ) {
$th .= '<span class="description">' . $field['subtitle'] . '</span>';
}
}
if (!empty($th)) {
$th = '<div class="redux_field_th">'.$th.'</div>';
}
if ( $this->args['default_show'] === true && isset( $field['default'] ) && isset($this->options[$field['id']]) && $this->options[$field['id']] != $field['default'] && $field['type'] !== "info" && $field['type'] !== "group" && $field['type'] !== "section" && $field['type'] !== "editor" && $field['type'] !== "ace_editor" ) {
$th .= $this->get_default_output_string($field);
}
echo "<th>{$th}</th><td>";
// Set field class, if it exists.
if (isset($field['class'])) {
$field['class'] .= " group";
} else {
$field['class'] = " group";
}
// Check for field id in slide array and set it to $value
//echo 'id: ' . $field['id'] . ' ';
if (isset($group[$field['id']]) && !empty($group[$field['id']])) {
$value = $group[$field['id']];
} else {
$value = '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment