This repository was archived by the owner on Dec 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
redux-core/inc/fields/image_select Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1919 */
2020 class Redux_Image_Select extends Redux_Field {
2121
22+ public function set_defaults (){
23+ $ defaults = array (
24+ 'tiles ' => false ,
25+ 'mode ' => 'background-image ' ,
26+ 'presets ' => false ,
27+ 'options ' => array (),
28+ 'width ' => '' ,
29+ 'height ' => '' ,
30+ );
31+
32+ $ this ->field = wp_parse_args ( $ this ->field , $ defaults );
33+ }
34+
2235 /**
2336 * Field Render Function.
2437 * Takes the vars and outputs the HTML for the field in the settings
@@ -78,7 +91,7 @@ public function render() {
7891
7992 $ the_value = $ k ;
8093
81- if ( ! empty ( $ this ->field ['tiles ' ] ) && true === $ this ->field ['tiles ' ] ) {
94+ if ( ! empty ( $ this ->field ['tiles ' ] ) && true === ( boolean ) $ this ->field ['tiles ' ] ) {
8295 $ the_value = $ v ['img ' ];
8396 }
8497
@@ -212,7 +225,7 @@ public function css_style( $data ) {
212225 if ( ! empty ( $ data ) && ! is_array ( $ data ) ) {
213226 switch ( $ mode ) {
214227 case 'background-image ' :
215- if ( $ this ->field ['tiles ' ] ) {
228+ if ( isset ( $ this -> field [ ' tiles ' ] ) && true === ( boolean ) $ this ->field ['tiles ' ] ) {
216229 $ img = $ data ;
217230 } else {
218231 $ img = $ this ->field ['options ' ][ $ data ]['img ' ] ?? '' ;
You can’t perform that action at this time.
0 commit comments