Skip to content

Commit 7794fd7

Browse files
committed
code format, cleanup
Signed-off-by:KProvance <[email protected]>
1 parent 65ccc3c commit 7794fd7

35 files changed

+2435
-2417
lines changed

ReduxCore/assets/css/redux.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ReduxCore/assets/js/redux.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ReduxCore/inc/fields/section/field_section.less

100755100644
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.redux-main {
2-
.form-table-section-indented {
3-
width:95%;margin-left:5%;
4-
}
5-
.form-table-section tr:first-of-type th:first-of-type {
6-
padding:0px !important;
7-
}
2+
.form-table-section-indented {
3+
width:95%;margin-left:5%;
4+
}
5+
.form-table-section tr:first-of-type th:first-of-type {
6+
padding:0px !important;
7+
}
88
h3 {
99
margin-top: 10px;
1010
}

ReduxCore/inc/fields/section/field_section.php

100755100644
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/**
43
* Redux Framework is free software: you can redistribute it and/or modify
54
* it under the terms of the GNU General Public License as published by
@@ -19,6 +18,7 @@
1918
* @author Tobias Karnetze (athoss.de)
2019
* @version 1.0.0
2120
*/
21+
2222
// Exit if accessed directly
2323
if (!defined('ABSPATH'))
2424
exit;
@@ -43,11 +43,9 @@ class ReduxFramework_section {
4343
* @return void
4444
*/
4545
public function __construct($field = array(), $value = '', $parent) {
46-
47-
//parent::__construct( $parent->sections, $parent->args );
48-
$this->parent = $parent;
49-
$this->field = $field;
50-
$this->value = $value;
46+
$this->parent = $parent;
47+
$this->field = $field;
48+
$this->value = $value;
5149
}
5250

5351
/**
@@ -63,14 +61,14 @@ public function render() {
6361

6462
// No errors please
6563
$defaults = array(
66-
'indent' => '',
67-
'style' => '',
68-
'class' => '',
69-
'title' => '',
70-
'subtitle' => '',
64+
'indent' => '',
65+
'style' => '',
66+
'class' => '',
67+
'title' => '',
68+
'subtitle' => '',
7169
);
7270
$this->field = wp_parse_args($this->field, $defaults);
73-
71+
7472
$guid = uniqid();
7573

7674
$add_class = '';
@@ -80,35 +78,37 @@ public function render() {
8078

8179
echo '<style>#' . $this->parent->args['opt_name'] . '-' . $this->field['id'] . ' {padding: 10px 0;}</style>';
8280
echo '</td></tr></table><div id="section-' . $this->field['id'] . '" class="redux-section-field redux-field ' . $this->field['style'] . $this->field['class'] . '">';
81+
8382
if (!empty($this->field['title'])) {
8483
echo '<h3>' . $this->field['title'] . '</h3>';
8584
}
85+
8686
if (!empty($this->field['subtitle'])) {
8787
echo '<div class="redux-section-desc">' . $this->field['subtitle'] . '</div>';
8888
}
8989

90-
//echo '</div><table class="form-table form-table-section no-border' . $add_class . '"><tbody><tr><th></th><td>';
91-
echo '</div><table id="section-table-' . $this->field['id'] . '" class="form-table form-table-section no-border'.$add_class.'"><tbody><tr><th></th><td id="'. $guid .'">';
92-
90+
echo '</div><table id="section-table-' . $this->field['id'] . '" class="form-table form-table-section no-border' . $add_class . '"><tbody><tr><th></th><td id="' . $guid . '">';
91+
9392
// delete the tr afterwards
94-
?>
93+
?>
9594
<script type="text/javascript">
96-
jQuery(document).ready(function(){
97-
var elem = jQuery("#<?php echo $guid?>");
95+
jQuery(document).ready(function() {
96+
var elem = jQuery("#<?php echo $guid ?>");
9897
var prevelem = elem.closest("table").prev("h3").prev("p").prev("table");
9998
prevelem.find("tr").last().remove();
100-
elem.parent().remove();
101-
});
102-
</script>
103-
<?php
99+
elem.parent().remove();
100+
});
101+
</script>
102+
<?php
104103
}
105104

106105
public function enqueue() {
107106
wp_enqueue_style(
108-
'redux-field-section-css', ReduxFramework::$_url . 'inc/fields/section/field_section.css', time(), true
107+
'redux-field-section-css',
108+
ReduxFramework::$_url . 'inc/fields/section/field_section.css',
109+
time(),
110+
true
109111
);
110112
}
111-
112113
}
113-
114114
}

0 commit comments

Comments
 (0)