mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 01:24:27 +00:00
Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - FSE: Add welcome guide - Update theme styles for the code block - Add feature flag to toggle the new site editor sidebar - Add templates list page for site editor - Cover Block: Fix default background dim - E2E: Add more Cover block tests - Cover Block: Fix regressions - Post Comments Form: ensure typography styles are applied to child elements - Navigation: Fix space-between - Fix background colours in nested submenus. - Fix duplicate custom classnames in navigation submenu block - Fix colour rendering in Navigation overlay - Fix: Add ability to opt out of Core color palette V2 - Change @package to WordPress in block-library - Make the core color palette opt-in for themes with not theme.json - Remove textdomain from calendar block - Page List block: fix space before href attribute - Try: Let Featured Image block inherit dimensions, look like a placeholder - [Global Styles]: Add block icon next to blocks list - Page List: Use core entities instead of direct apiFetch - Site Editor: Stabilize export endpoint - Fix mobile horizontal scrollbar. - Multi-entity save: Only set site entity to pending if really saving - Add page list to navigation direct insert conditions - Implement "Add New" for templates list in Site Editor - Post Featured Image: Remove withNotices HOC - Fix page list missing button styles when set to open on click. - Make appender fixed position to avoid jumps in the UI - Color UI component: reorder palettes and update names (core by defaults, user by custom) - Remove the Styles link in Site Editor - GlobalStyles sidebar: do not show default palette if theme opts-out - Only render the site editor canvas when the global styles are ready. - Global Styles: rename core origin key to default for presets - Clarify i18n context for PostTemplateActions's "New" label - Revert erroneous native editor package version bumps - Try: Hide the columns inserter in pattern previews. - Fix site editor region navigation - Update navigation sidebar responsiveness - Add _wp_array_set and _wp_to_kebab_case to 5.8 compat - Make user able to change all color palette origins - Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site - Site Editor: Validate the postType query argument - Navigation: Scale submenu icon. - Move the theme editor under tools for FSE themes - Deprecate navigation areas See #54487. git-svn-id: https://develop.svn.wordpress.org/trunk@52232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -51,7 +51,7 @@ class WP_Theme_JSON {
|
||||
* @var string[]
|
||||
*/
|
||||
const VALID_ORIGINS = array(
|
||||
'core',
|
||||
'default',
|
||||
'theme',
|
||||
'user',
|
||||
);
|
||||
@@ -220,15 +220,17 @@ class WP_Theme_JSON {
|
||||
'width' => null,
|
||||
),
|
||||
'color' => array(
|
||||
'background' => null,
|
||||
'custom' => null,
|
||||
'customDuotone' => null,
|
||||
'customGradient' => null,
|
||||
'duotone' => null,
|
||||
'gradients' => null,
|
||||
'link' => null,
|
||||
'palette' => null,
|
||||
'text' => null,
|
||||
'background' => null,
|
||||
'custom' => null,
|
||||
'customDuotone' => null,
|
||||
'customGradient' => null,
|
||||
'defaultGradients' => null,
|
||||
'defaultPalette' => null,
|
||||
'duotone' => null,
|
||||
'gradients' => null,
|
||||
'link' => null,
|
||||
'palette' => null,
|
||||
'text' => null,
|
||||
),
|
||||
'custom' => null,
|
||||
'layout' => array(
|
||||
@@ -324,7 +326,7 @@ class WP_Theme_JSON {
|
||||
*
|
||||
* @param array $theme_json A structure that follows the theme.json schema.
|
||||
* @param string $origin Optional. What source of data this object represents.
|
||||
* One of 'core', 'theme', or 'user'. Default 'theme'.
|
||||
* One of 'default', 'theme', or 'user'. Default 'theme'.
|
||||
*/
|
||||
public function __construct( $theme_json = array(), $origin = 'theme' ) {
|
||||
if ( ! in_array( $origin, self::VALID_ORIGINS, true ) ) {
|
||||
@@ -343,7 +345,9 @@ class WP_Theme_JSON {
|
||||
$path = array_merge( $node['path'], $preset_metadata['path'] );
|
||||
$preset = _wp_array_get( $this->theme_json, $path, null );
|
||||
if ( null !== $preset ) {
|
||||
_wp_array_set( $this->theme_json, $path, array( $origin => $preset ) );
|
||||
if ( 'user' !== $origin || isset( $preset[0] ) ) {
|
||||
_wp_array_set( $this->theme_json, $path, array( $origin => $preset ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1472,46 +1476,48 @@ class WP_Theme_JSON {
|
||||
private static function remove_insecure_settings( $input ) {
|
||||
$output = array();
|
||||
foreach ( self::PRESETS_METADATA as $preset_metadata ) {
|
||||
$presets = _wp_array_get( $input, $preset_metadata['path'], null );
|
||||
if ( null === $presets ) {
|
||||
continue;
|
||||
}
|
||||
foreach ( self::VALID_ORIGINS as $origin ) {
|
||||
$path_with_origin = array_merge( $preset_metadata['path'], array( $origin ) );
|
||||
$presets = _wp_array_get( $input, $path_with_origin, null );
|
||||
if ( null === $presets ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$escaped_preset = array();
|
||||
foreach ( $presets as $preset ) {
|
||||
if (
|
||||
esc_attr( esc_html( $preset['name'] ) ) === $preset['name'] &&
|
||||
sanitize_html_class( $preset['slug'] ) === $preset['slug']
|
||||
) {
|
||||
$value = null;
|
||||
if ( isset( $preset_metadata['value_key'] ) ) {
|
||||
$value = $preset[ $preset_metadata['value_key'] ];
|
||||
} elseif (
|
||||
isset( $preset_metadata['value_func'] ) &&
|
||||
is_callable( $preset_metadata['value_func'] )
|
||||
$escaped_preset = array();
|
||||
foreach ( $presets as $preset ) {
|
||||
if (
|
||||
esc_attr( esc_html( $preset['name'] ) ) === $preset['name'] &&
|
||||
sanitize_html_class( $preset['slug'] ) === $preset['slug']
|
||||
) {
|
||||
$value = call_user_func( $preset_metadata['value_func'], $preset );
|
||||
}
|
||||
$value = null;
|
||||
if ( isset( $preset_metadata['value_key'] ) ) {
|
||||
$value = $preset[ $preset_metadata['value_key'] ];
|
||||
} elseif (
|
||||
isset( $preset_metadata['value_func'] ) &&
|
||||
is_callable( $preset_metadata['value_func'] )
|
||||
) {
|
||||
$value = call_user_func( $preset_metadata['value_func'], $preset );
|
||||
}
|
||||
|
||||
$preset_is_valid = true;
|
||||
foreach ( $preset_metadata['properties'] as $property ) {
|
||||
if ( ! self::is_safe_css_declaration( $property, $value ) ) {
|
||||
$preset_is_valid = false;
|
||||
break;
|
||||
$preset_is_valid = true;
|
||||
foreach ( $preset_metadata['properties'] as $property ) {
|
||||
if ( ! self::is_safe_css_declaration( $property, $value ) ) {
|
||||
$preset_is_valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $preset_is_valid ) {
|
||||
$escaped_preset[] = $preset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $preset_is_valid ) {
|
||||
$escaped_preset[] = $preset;
|
||||
}
|
||||
if ( ! empty( $escaped_preset ) ) {
|
||||
_wp_array_set( $output, $path_with_origin, $escaped_preset );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $escaped_preset ) ) {
|
||||
_wp_array_set( $output, $preset_metadata['path'], $escaped_preset );
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user