@@ -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