PluginProbe
Gutenberg / 16.2.0
Gutenberg v16.2.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | lib/block-supports/position.php +5 -5 23.7.0 → 16.2.0 View file →
@@ -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.