| @@ -43,10 +43,10 @@ | ||
| 43 | 43 | return $block_content; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $global_settings = gutenberg_get_global_settings(); |
| 47 | - $theme_has_sticky_support = $global_settings['position']['sticky'] ?? false; | |
| 48 | - $theme_has_fixed_support = $global_settings['position']['fixed'] ?? false; | |
| 47 | + $theme_has_sticky_support = _wp_array_get( $global_settings, array( 'position', 'sticky' ), false ); | |
| 48 | + $theme_has_fixed_support = _wp_array_get( $global_settings, array( 'position', 'fixed' ), false ); | |
| 49 | 49 | |
| 50 | 50 | // Only allow output for position types that the theme supports. |
| 51 | 51 | $allowed_position_types = array(); |
| 52 | 52 | if ( true === $theme_has_sticky_support ) { |
| @@ -55,13 +55,13 @@ | ||
| 55 | 55 | if ( true === $theme_has_fixed_support ) { |
| 56 | 56 | $allowed_position_types[] = 'fixed'; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $style_attribute = $block['attrs']['style'] ?? null; | |
| 59 | + $style_attribute = _wp_array_get( $block, array( 'attrs', 'style' ), null ); | |
| 60 | 60 | $class_name = wp_unique_id( 'wp-container-' ); |
| 61 | 61 | $selector = ".$class_name"; |
| 62 | 62 | $position_styles = array(); |
| 63 | - $position_type = $style_attribute['position']['type'] ?? ''; | |
| 63 | + $position_type = _wp_array_get( $style_attribute, array( 'position', 'type' ), '' ); | |
| 64 | 64 | $wrapper_classes = array(); |
| 65 | 65 | |
| 66 | 66 | if ( |
| 67 | 67 | in_array( $position_type, $allowed_position_types, true ) |
| @@ -70,9 +70,9 @@ | ||
| 70 | 70 | $wrapper_classes[] = 'is-position-' . $position_type; |
| 71 | 71 | $sides = array( 'top', 'right', 'bottom', 'left' ); |
| 72 | 72 | |
| 73 | 73 | foreach ( $sides as $side ) { |
| 74 | - $side_value = $style_attribute['position'][ $side ] ?? null; | |
| 74 | + $side_value = _wp_array_get( $style_attribute, array( 'position', $side ) ); | |
| 75 | 75 | if ( null !== $side_value ) { |
| 76 | 76 | /* |
| 77 | 77 | * For fixed or sticky top positions, |
| 78 | 78 | * ensure the value includes an offset for the logged in admin bar. |