Skip to content

Commit

Permalink
Editor: Introduce sticky position block support.
Browse files Browse the repository at this point in the history
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.
Built from https://develop.svn.wordpress.org/trunk@55285


git-svn-id: http://core.svn.wordpress.org/trunk@54818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
dream-encode committed Feb 7, 2023
1 parent c03b342 commit f5d681f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ class WP_Theme_JSON {
* and `typography`, and renamed others according to the new schema.
* @since 6.0.0 Added `color.defaultDuotone`.
* @since 6.1.0 Added `layout.definitions` and `useRootPaddingAwareAlignments`.
* @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', and 'shadow.defaultPresets'.
* @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', 'shadow.defaultPresets',
* `position.fixed` and `position.sticky`.
* @var array
*/
const VALID_SETTINGS = array(
Expand Down Expand Up @@ -339,6 +340,10 @@ class WP_Theme_JSON {
'definitions' => null,
'wideSize' => null,
),
'position' => array(
'fixed' => null,
'sticky' => null,
),
'spacing' => array(
'customSpacingSize' => null,
'spacingSizes' => null,
Expand Down Expand Up @@ -513,7 +518,7 @@ public static function get_element_class_name( $element ) {
* Options that settings.appearanceTools enables.
*
* @since 6.0.0
* @since 6.2.0 Added `dimensions.minHeight`.
* @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`.
* @var array
*/
const APPEARANCE_TOOLS_OPT_INS = array(
Expand All @@ -523,6 +528,7 @@ public static function get_element_class_name( $element ) {
array( 'border', 'width' ),
array( 'color', 'link' ),
array( 'dimensions', 'minHeight' ),
array( 'position', 'sticky' ),
array( 'spacing', 'blockGap' ),
array( 'spacing', 'margin' ),
array( 'spacing', 'padding' ),
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2-alpha-55284';
$wp_version = '6.2-alpha-55285';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down
1 change: 1 addition & 0 deletions wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
require ABSPATH . WPINC . '/block-supports/elements.php';
require ABSPATH . WPINC . '/block-supports/generated-classname.php';
require ABSPATH . WPINC . '/block-supports/layout.php';
require ABSPATH . WPINC . '/block-supports/position.php';
require ABSPATH . WPINC . '/block-supports/spacing.php';
require ABSPATH . WPINC . '/block-supports/typography.php';
require ABSPATH . WPINC . '/block-supports/settings.php';
Expand Down

0 comments on commit f5d681f

Please sign in to comment.