File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
sample/sections/color-selection Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -950,13 +950,28 @@ private function get_default_output_string( array $field ): string {
950950 }
951951 } else {
952952 foreach ( $ field ['default ' ] as $ defaultk => $ defaultv ) {
953+ $ defaultk = is_numeric ( $ defaultk ) ? (string ) $ defaultk : $ defaultk ;
954+ $ defaultv = is_numeric ( $ defaultv ) ? (string ) $ defaultv : $ defaultv ;
955+
953956 if ( ! empty ( $ field ['options ' ][ $ defaultv ]['alt ' ] ) ) {
954957 $ default_output .= $ field ['options ' ][ $ defaultv ]['alt ' ] . ', ' ;
955958 } elseif ( ! empty ( $ field ['options ' ][ $ defaultv ] ) ) {
956959 $ default_output .= $ field ['options ' ][ $ defaultv ] . ', ' ;
957960 } elseif ( ! empty ( $ field ['options ' ][ $ defaultk ] ) ) {
958961 $ default_output .= $ field ['options ' ][ $ defaultk ] . ', ' ;
959962 } elseif ( ! empty ( $ defaultv ) ) {
963+ if ( is_array ( $ defaultv ) ) {
964+ foreach ( $ defaultv as $ k => $ v ) {
965+ if ( is_array ( $ v ) ) {
966+ $ defaultv = implode ( ', ' , $ v );
967+ }
968+ }
969+
970+ if ( is_array ( $ defaultv ) ) {
971+ $ defaultv = implode ( ', ' , $ defaultv );
972+ }
973+ }
974+
960975 $ default_output .= $ defaultv . ', ' ;
961976 }
962977 }
Original file line number Diff line number Diff line change 2323 'subtitle ' => esc_html__ ( 'Gives you the RGBA color. ' , 'your-textdomain-here ' ),
2424 'default ' => array (
2525 'color ' => '#7e33dd ' ,
26- 'alpha ' => ' .8 ' ,
26+ 'alpha ' => .8 ,
2727 ),
2828 'output ' => array (
2929 'color ' => '.posted-on, .wp-block-post-date a ' ,
You can’t perform that action at this time.
0 commit comments