This repository was archived by the owner on Dec 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -358,13 +358,17 @@ public function css_style( $data ) {
358358 if ( 'units ' === $ key ) {
359359 continue ;
360360 }
361+ $ the_units = $ units ;
361362
362363 // Strip off any alpha for is_numeric test - kp.
363364 $ num_no_alpha = preg_replace ( '/[^\d.-]/ ' , '' , $ value );
365+ if ( empty ( $ the_units ) ) {
366+ $ the_units = str_replace ( $ num_no_alpha , '' , $ value );
367+ }
364368
365369 // Output if it's a numeric entry.
366370 if ( isset ( $ value ) && is_numeric ( $ num_no_alpha ) ) {
367- $ style .= $ key . ': ' . $ num_no_alpha . $ units . '; ' ;
371+ $ style .= $ key . ': ' . $ num_no_alpha . $ the_units . '; ' ;
368372 }
369373 }
370374
Original file line number Diff line number Diff line change @@ -1007,8 +1007,8 @@ public function output( $style = '' ) {
10071007 $ font = $ this ->value ;
10081008
10091009 if ( '' !== $ style ) {
1010- if ( ! empty ( $ field ['output ' ] ) && ! is_array ( $ field ['output ' ] ) ) {
1011- $ field ['output ' ] = array ( $ field ['output ' ] );
1010+ if ( ! empty ( $ this -> field ['output ' ] ) && ! is_array ( $ this -> field ['output ' ] ) ) {
1011+ $ this -> field ['output ' ] = array ( $ this -> field ['output ' ] );
10121012 }
10131013
10141014 if ( ! empty ( $ this ->field ['output ' ] ) && is_array ( $ this ->field ['output ' ] ) ) {
You can’t perform that action at this time.
0 commit comments