Make WordPress Core

Changeset 55285


Ignore:
Timestamp:
02/07/2023 05:59:44 PM (19 months ago)
Author:
davidbaumwald
Message:

Editor: Introduce sticky position block support.

In the Gutenberg plugin, a position block support feature was introduced last year, that allows a Group block to be set to a "sticky" position, meaning that when the page scrolls, the block will stick to the top of the window.

This change merges the "sticky" position feature for blocks introduced in Gutenberg 15.0.

Props andrewserong, flixos90, mukesh27.
Fixes #57618.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r55255 r55285  
    305305     * @since 6.0.0 Added `color.defaultDuotone`.
    306306     * @since 6.1.0 Added `layout.definitions` and `useRootPaddingAwareAlignments`.
    307      * @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', and 'shadow.defaultPresets'.
     307     * @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', 'shadow.defaultPresets',
     308     *              `position.fixed` and `position.sticky`.
    308309     * @var array
    309310     */
     
    339340            'definitions' => null,
    340341            'wideSize'    => null,
     342        ),
     343        'position'                      => array(
     344            'fixed'  => null,
     345            'sticky' => null,
    341346        ),
    342347        'spacing'                       => array(
     
    514519     *
    515520     * @since 6.0.0
    516      * @since 6.2.0 Added `dimensions.minHeight`.
     521     * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`.
    517522     * @var array
    518523     */
     
    524529        array( 'color', 'link' ),
    525530        array( 'dimensions', 'minHeight' ),
     531        array( 'position', 'sticky' ),
    526532        array( 'spacing', 'blockGap' ),
    527533        array( 'spacing', 'margin' ),
  • trunk/src/wp-settings.php

    r55255 r55285  
    337337require ABSPATH . WPINC . '/block-supports/generated-classname.php';
    338338require ABSPATH . WPINC . '/block-supports/layout.php';
     339require ABSPATH . WPINC . '/block-supports/position.php';
    339340require ABSPATH . WPINC . '/block-supports/spacing.php';
    340341require ABSPATH . WPINC . '/block-supports/typography.php';
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r55246 r55285  
    275275                'minHeight' => true,
    276276            ),
     277            'position'   => array(
     278                'sticky' => true,
     279            ),
    277280            'spacing'    => array(
    278281                'blockGap' => false,
     
    301304                    'dimensions' => array(
    302305                        'minHeight' => true,
     306                    ),
     307                    'position'   => array(
     308                        'sticky' => true,
    303309                    ),
    304310                    'spacing'    => array(
Note: See TracChangeset for help on using the changeset viewer.