Skip to content

Commit abdc3ef

Browse files
committed
#4042 - multi_media field not saving or retaining data in customizer.
1 parent 347abc7 commit abdc3ef

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

redux-core/assets/css/redux-fields.min.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.

redux-core/assets/css/redux-fields.min.css.map

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

redux-core/inc/extensions/customizer/class-redux-extension-customizer.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,63 +34,63 @@ class Redux_Extension_Customizer extends Redux_Extension_Abstract {
3434
*
3535
* @var string
3636
*/
37-
public $field_name = 'customizer';
37+
public string $field_name = 'customizer';
3838

3939
/**
4040
* Set the friendly name of the extension. This is for display purposes. No underscores or dashes are required.
4141
*
4242
* @var string
4343
*/
44-
public $extension_name = 'Customizer';
44+
public string $extension_name = 'Customizer';
4545

4646
/**
4747
* Original options.
4848
*
49-
* @var array
49+
* @var array|null
5050
*/
51-
private $orig_options = array();
51+
private ?array $orig_options = array();
5252

5353
/**
5454
* Post values.
5555
*
56-
* @var array
56+
* @var array|null
5757
*/
58-
private static $post_values = array();
58+
private static ?array $post_values = array();
5959

6060
/**
6161
* Options array.
6262
*
63-
* @var array
63+
* @var array|null
6464
*/
65-
public $options = array();
65+
public ?array $options = array();
6666

6767
/**
6868
* Controls array.
6969
*
70-
* @var array
70+
* @var array|null
7171
*/
72-
public $controls = array();
72+
public ?array $controls = array();
7373

7474
/**
7575
* Before save array.
7676
*
77-
* @var array
77+
* @var array|null
7878
*/
79-
public $before_save = array();
79+
public ?array $before_save = array();
8080

8181
/**
8282
* Redux object.
8383
*
84-
* @var object
84+
* @var ReduxFramework|null
8585
*/
86-
protected $redux;
86+
protected ?ReduxFramework $redux;
8787

8888
/**
8989
* Field array.
9090
*
91-
* @var array
91+
* @var array|null
9292
*/
93-
private $redux_fields = array();
93+
private ?array $redux_fields = array();
9494

9595
/**
9696
* Redux_Extension_my_extension constructor.
@@ -430,7 +430,7 @@ public function register_customizer_controls( WP_Customize_Manager $wp_customize
430430
// Not a type that should go on the customizer.
431431

432432
foreach ( $section['fields'] as $field ) {
433-
if ( /* 'color_scheme' === $field['type'] || */ 'divide' === $field['type'] ) {
433+
if ( 'color_scheme' === $field['type'] || 'divide' === $field['type'] ) {
434434
continue 2;
435435
}
436436
}

redux-core/inc/extensions/multi_media/multi_media/class-redux-multi-media.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ class="redux-multi-media-container' . esc_attr( $this->field['class'] ) . '"
7777

7878
// Hidden inout for file(s).
7979
echo '<input
80-
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
80+
data-name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
8181
id="' . esc_attr( $field_id ) . '-multi-media"
8282
class="redux_upload_file redux_upload_list"
8383
type="hidden"
84-
value=""
8584
size="45" />';
8685

8786
// Upload button.

redux-core/inc/extensions/multi_media/multi_media/redux-multi-media.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
const $formfield = $( '#' + inputID );
168168

169169
// Get form name.
170-
const formName = $formfield.attr( 'name' );
170+
const formName = $formfield.data( 'name' );
171171

172172
const mainID = selector.attr( 'data-id' );
173173

redux-core/inc/extensions/multi_media/multi_media/redux-multi-media.min.js

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

0 commit comments

Comments
 (0)