-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update @wordpress packages #1967
Conversation
I've yet to test this. It's possible that some or all of these need to be committed first: |
I've merged #1937 into this branch. |
@Mamaduka: Could you please fix the @adamziel: Do you know why |
@noisysocks we should probably sync |
Noting this Trac ticket https://core.trac.wordpress.org/ticket/54532 and Gutenberg issue WordPress/gutenberg#36962 for consideration before Beta 1. |
Update: I've noticed we were missing another flag ( |
Hi, looking at the The contents of diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php
index 4cdb44e457..635f670cff 100644
--- a/src/wp-includes/class-wp-theme-json.php
+++ b/src/wp-includes/class-wp-theme-json.php
@@ -75,17 +75,28 @@ class WP_Theme_JSON {
* This contains the necessary metadata to process them:
*
* - path => where to find the preset within the settings section
-+ * - override => whether a theme preset with the same slug as a default preset
-+ * can override it
+ * - override => whether a theme preset with the same slug as a default preset
+ * can override it
* - value_key => the key that represents the value
- * - value_func => the callback to render the value (either value_key or value_func should be present)
+ * - value_func => optionally, instead of value_key, a function to generate
+ * the value that takes a preset as an argument
+ * (either value_key or value_func should be present)
* - css_vars => template string to use in generating the CSS Custom Property.
* Example output: "--wp--preset--duotone--blue: <value>" will generate as many CSS Custom Properties as presets defined
* substituting the $slug for the slug's value for each preset value.
- * - classes => array containing a structure with the classes to generate for the presets.
- * Each key is a template string to resolve similarly to the css_vars and each value is the CSS property to use for that class.
- * Example output: ".has-blue-color { color: <value> }"
- * - properties => a list of CSS properties to be used by kses to check the preset value is safe.
+ * - classes => array containing a structure with the classes to
+ * generate for the presets, where for each array item
+ * the key is the class name and the value the property name.
+ * The "$slug" substring will be replaced by the slug of each preset.
+ * For example:
+ * 'classes' => array(
+ * '.has-$slug-color' => 'color',
+ * '.has-$slug-background-color' => 'background-color',
+ * '.has-$slug-border-color' => 'border-color',
+ * )
+ * - properties => array of CSS properties to be used by kses to
+ * validate the content of each preset
+ * by means of the remove_insecure_properties method.
*
* @since 5.8.0
* @since 5.9.0 Added new presets and simplified the metadata structure.
@@ -305,6 +316,8 @@ class WP_Theme_JSON {
);
/**
+ * The valid elements that can be found under styles.
+ *
* @since 5.8.0
* @var string[]
*/
@@ -479,6 +492,7 @@ class WP_Theme_JSON {
return $output;
}
+
/**
* Returns the metadata for each block.
* |
@@ -75,6 +75,8 @@ class WP_Theme_JSON { | |||
* This contains the necessary metadata to process them: | |||
* | |||
* - path => where to find the preset within the settings section | |||
+ * - override => whether a theme preset with the same slug as a default preset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There're a couple of extra +
here. I've sent a patch to fix that and other minor changes at #1967 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also prepared this Gutenberg PR WordPress/gutenberg#36973 to make sure that the order of constants, methods, etc. as well as the PHPDoc comments are the same between the Gutenberg's lib/class-wp-theme-json-gutenberg.php
and WordPress core wp-includes/class-wp-theme-json.php
.
This way the backports are way easier and require minimal manual intervention.
Got to review the diff --git a/src/wp-includes/class-wp-theme-json-resolver.php b/src/wp-includes/class-wp-theme-json-resolver.php
index 6a7e6a5bf9..659365b6ef 100644
--- a/src/wp-includes/class-wp-theme-json-resolver.php
+++ b/src/wp-includes/class-wp-theme-json-resolver.php
@@ -230,7 +230,6 @@ class WP_Theme_JSON_Resolver {
* @param array $post_status_filter Filter Optional. custom post type by
* post status. ['publish'] by default,
* so it only fetches published posts.
- *
* @return array Custom Post Type for the user's origin config.
*/
public static function get_user_data_from_custom_post_type( $theme, $should_create_cpt = false, $post_status_filter = array( 'publish' ) ) {
@@ -333,8 +332,8 @@ class WP_Theme_JSON_Resolver {
/**
* There are three sources of data (origins) for a site:
- * default, theme, and user. The user's has higher priority
- * than the theme's, and the theme's higher than core's.
+ * default, theme, and custom. The custom's has higher priority
+ * than the theme's, and the theme's higher than defaults's.
*
* Unlike the getters {@link get_core_data},
* {@link get_theme_data}, and {@link get_user_data}, I'm making some changes to the equivalent Gutenberg class to make the backports easier at WordPress/gutenberg#36974 |
We need to ensure that WordPress/gutenberg#36981 is merged and backported as well. |
Thanks @oandregal for the review and fixes. I'm going to apply those patches and commit this patch, and then follow up with a second commit to address WordPress/gutenberg#36962 and WordPress/gutenberg#36981. That way if I run into roadblocks we'll still have something in for beta 1 😀 |
@noisysocks need to make sure that the |
Co-authored-by: Adam Zielinski <adam@adamziel.com>
Co-authored-by: Adam Zielinski <adam@adamziel.com>
Co-authored-by: Adam Zielinski <adam@adamziel.com>
bd3461a
to
2da12cb
Compare
This patch doesn't modify |
Gave this a smoke test locally and nothing seems amiss. Committing! |
Update packages to include these bug fixes from Gutenberg:
appearanceTools
flag to opt-in into appearance UI controls gutenberg#36646DateTimePicker
: set PM hours correctly gutenberg#36878gutenberg_
towp_
for some functions that land in WordPress 5.9 gutenberg#36913Trac ticket: https://core.trac.wordpress.org/ticket/54487
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.