Skip to content

Commit e272e9b

Browse files
committed
Fix for issue #1088. Info field now indents when in section.
1 parent 9fc471c commit e272e9b

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

ReduxCore/framework.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ReduxFramework {
6060
// ATTENTION DEVS
6161
// Please update the build number with each push, no matter how small.
6262
// This will make for easier support when we ask users what version they are using.
63-
public static $_version = '3.2.1';
63+
public static $_version = '3.2.1.2';
6464
public static $_dir;
6565
public static $_url;
6666
public static $wp_content_url;
@@ -2113,7 +2113,7 @@ public function _register_settings() {
21132113
}
21142114
}
21152115
add_settings_section( $this->args['opt_name'] . $k . '_section', $heading, array( &$this, '_section_desc' ), $this->args['opt_name'] . $k . '_section_group' );
2116-
2116+
$sectionIndent = false;
21172117
if( isset( $section['fields'] ) ) {
21182118
foreach( $section['fields'] as $fieldk => $field ) {
21192119
if ( !isset( $field['type'] ) ) {
@@ -2148,6 +2148,16 @@ public function _register_settings() {
21482148
continue;
21492149
}
21502150

2151+
if ( isset( $field['type'] ) && $field['type'] == "section" ) {
2152+
if ( isset( $field['indent'] ) && $field['indent'] == true ) {
2153+
$sectionIndent = true;
2154+
} else {
2155+
$sectionIndent = false;
2156+
}
2157+
}
2158+
if ( isset( $field['type'] ) && $field['type'] == "info" && $sectionIndent ) {
2159+
$field['sectionIndent'] = $sectionIndent;
2160+
}
21512161
$th = $this->get_header_html( $field );
21522162

21532163
$field['name'] = $this->args['opt_name'] . '[' . $field['id'] . ']';

ReduxCore/inc/fields/info/field_info.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ public function render() {
9898
$this->field['style'] = 'redux-' . $this->field['style'].' ';
9999
}
100100

101-
echo '</td></tr></table><div id="info-' . $this->field['id'] . '" class="' . $this->field['style'] . $this->field['class'] . ' redux-field-'.$this->field['type'].'">';
101+
$indent = (isset($this->field['sectionIndent']) && $this->field['sectionIndent']) ? ' form-table-section-indented' : '';
102+
103+
echo '</td></tr></table><div id="info-' . $this->field['id'] . '" class="' . $this->field['style'] . $this->field['class'] . ' redux-field-'.$this->field['type'].$indent.'">';
102104

103105
if ( !empty($this->field['raw_html']) && $this->field['raw_html'] ) {
104106
echo $this->field['desc'];

0 commit comments

Comments
 (0)