Skip to content

Commit 74cdffb

Browse files
added default values for some get_option
1 parent 2e73dc8 commit 74cdffb

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/dynamic-breakpoints.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function get_dynamic_breakpoints() {
6767
) );
6868

6969
// Check if there are saved custom breakpoints from our settings.
70-
$saved_breakpoints = get_option( 'stackable_dynamic_breakpoints' );
70+
$saved_breakpoints = get_option( 'stackable_dynamic_breakpoints', false );
7171
if ( ! empty( $saved_breakpoints ) ) {
7272
// Set breakpoints for tablet and mobile if they are set.
7373
if ( ! empty( $saved_breakpoints['tablet'] ) ) {

src/global-settings.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,8 @@ function __construct() {
7373
if ( $this->has_global_typography() ) {
7474
$this->force_typography = get_option( 'stackable_global_force_typography' );
7575
add_action( 'after_setup_theme', array( $this, 'typography_parse_global_styles' ) );
76-
}
7776

78-
// Optimize by avoiding repeated calls to get_apply_typography_to() and unnecessary filter registration.
79-
// Only do this if we have global typography.
80-
if ( $this->has_global_typography() ) {
77+
// Optimize by avoiding repeated calls to get_apply_typography_to() and unnecessary filter registration.
8178
$apply_typography_to = $this->get_apply_typography_to();
8279
if ( $apply_typography_to === 'blocks-stackable-native' || $apply_typography_to === 'blocks-all' ) {
8380
add_filter( 'render_block', array( $this, 'typography_detect_native_blocks' ), 10, 2 );
@@ -571,7 +568,7 @@ public function color_add_global_styles( $current_css ) {
571568
* @return boolean
572569
*/
573570
public function has_global_typography() {
574-
$typography = get_option( 'stackable_global_typography' );
571+
$typography = get_option( 'stackable_global_typography', false );
575572
if ( empty( $typography ) ) {
576573
return false;
577574
}
@@ -589,7 +586,7 @@ public function has_global_typography() {
589586
* @return void
590587
*/
591588
public function typography_parse_global_styles() {
592-
$typography = get_option( 'stackable_global_typography' );
589+
$typography = get_option( 'stackable_global_typography', false );
593590
if ( ! $typography || ! is_array( $typography ) ) {
594591
return;
595592
}

0 commit comments

Comments
 (0)