Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit a7c0d5d

Browse files
committed
Fix for typography without an array output as well as a bug with the default values for spacing.
1 parent cdfd862 commit a7c0d5d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

redux-core/inc/fields/spacing/class-redux-spacing.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

redux-core/inc/fields/typography/class-redux-typography.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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'] ) ) {

0 commit comments

Comments
 (0)