-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Layout: Add a disable-layout-styles theme supports flag to opt out of…
… all layout styles (#42544) * Layout: Add a disable-layout-styles theme supports flag to opt-out of all layout styles * Try adding documentation entry * Fix behaviour in site editor * Add register_theme_feature call to ensure the feature is registered so it appears in API responses * Remove useThemeHasDisabledLayoutStyles hook to simplify feature checks
- Loading branch information
1 parent
bc79532
commit 3c2ee63
Showing
12 changed files
with
161 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Temporary compatibility shims for features present in Gutenberg. | ||
* This file should be removed when WordPress 6.1.0 becomes the lowest | ||
* supported version by this plugin. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* This function runs in addition to the core `create_initial_theme_features`. | ||
* The 6.1 release needs to update the core function to include the body of this function. | ||
* | ||
* Creates the initial theme features when the 'setup_theme' action is fired. | ||
* | ||
* See {@see 'setup_theme'}. | ||
* | ||
* @since 5.5.0 | ||
* @since 6.0.1 The `block-templates` feature was added. | ||
* @since 6.1.0 The `disable-layout-styles` feature was added. | ||
*/ | ||
function gutenberg_create_initial_theme_features() { | ||
register_theme_feature( | ||
'disable-layout-styles', | ||
array( | ||
'description' => __( 'Whether the theme disables generated layout styles.', 'gutenberg' ), | ||
'show_in_rest' => true, | ||
) | ||
); | ||
} | ||
add_action( 'setup_theme', 'gutenberg_create_initial_theme_features', 0 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters