BeTheme 28.5.3 -> 28.5.7 Unset laptop/tablet "Section side padding" emits 0px and overrides the desktop value Supplemental notes NOTE ON FORMATTING: PHP open/close tags are omitted throughout, and inline template echoes are shown in square brackets, because this site's firewall rejects uploads containing raw PHP tags. Everything else is verbatim from the shipped 28.5.7 package, and the line numbers are exact. -------------------------------------------------------------------------- 1. THE GATE File: style.php Lines 61 and 69 in 28.5.7 (introduced in 28.5.3, unchanged since) -------------------------------------------------------------------------- Line 61, with the PHP tags stripped: if ( mfn_opts_get( 'section-padding-laptop' ) >= 0 ) : @media only screen and (min-width:960px) and (max-width:1440px){ .section_wrapper { padding-left: [ echo esc_attr( mfn_opts_get( 'section-padding-laptop', 0, [ 'unit' => 'px' ] ) ) ]; padding-right: [ echo esc_attr( mfn_opts_get( 'section-padding-laptop', 0, [ 'unit' => 'px' ] ) ) ]; } } endif; Line 69 is the identical construct for 'section-padding-tablet', at (min-width:768px) and (max-width:959px). -------------------------------------------------------------------------- 2. WHY IT FIRES WHEN THE FIELD WAS NEVER SET -------------------------------------------------------------------------- mfn_opts_get returns its default, null, for an unset key. In PHP, null >= 0 evaluates to TRUE, so the block emits with the 0px fallback. MFN_Options::get (options.php, line 620) also normalises an empty saved value back to that same default: public function get( $opt_name, $default = null ) { if( ! is_array( $this->options ) ) { return $default; } if( ! key_exists( $opt_name, $this->options ) ) { return $default; } if( empty( $this->options[$opt_name] ) && ( '0' !== $this->options[$opt_name] ) ) { return $default; } return $this->options[$opt_name]; } So "never saved the options page" and "saved with the field blank" both arrive at the gate as null, and both emit. The gate cannot distinguish either of them from an explicit 0. -------------------------------------------------------------------------- 3. SUGGESTED FIX -------------------------------------------------------------------------- Gate on presence rather than a numeric comparison, so an explicit 0 still emits but unset or blank does not: $laptop_padding = mfn_opts_get( 'section-padding-laptop' ); if ( '' !== (string) $laptop_padding ) : Casting null or false to string yields an empty string, so unset and blank behave identically, while the string '0' passes and is emitted. The same change applies to 'section-padding-tablet'. -------------------------------------------------------------------------- 4. RELATED INCONSISTENCY -------------------------------------------------------------------------- The desktop block eight lines above, at style.php line 53, still uses the older truthiness gate: if ( mfn_opts_get( 'section-padding' ) ) : so an explicit desktop 0 still cannot emit. If the intent of the 28.5.3 change was to honour an explicit 0, the same presence gate would apply there too.