Commit e0e0928ca7 for wordpress.org
commit e0e0928ca70f199a7ee9e67645a9220ce01469f0
Author: isabel_brison <isabel_brison@git.wordpress.org>
Date: Wed Sep 23 09:55:50 2026 +0000
Editor: add public function to retrieve viewport state media queries.
Adds a wrapper for `WP_Theme_JSON::get_viewport_media_queries` so that custom blocks and custom block controls can make use of viewport states.
Props isabel_brison, ramonopoly.
Fixes #66150.
Built from https://develop.svn.wordpress.org/trunk@63889
git-svn-id: http://core.svn.wordpress.org/trunk@63061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/global-styles-and-settings.php b/wp-includes/global-styles-and-settings.php
index c4a3284dad..2315eef1ad 100644
--- a/wp-includes/global-styles-and-settings.php
+++ b/wp-includes/global-styles-and-settings.php
@@ -83,6 +83,28 @@ function wp_get_global_settings( $path = array(), $context = array() ) {
return _wp_array_get( $settings, $path, $settings );
}
+/**
+ * Returns CSS media queries for responsive viewport style states.
+ *
+ * Breakpoint values are read from the viewport settings, sanitized, and
+ * normalized before the media query strings are generated. By default, the
+ * returned keys are `@mobile` and `@tablet`. When `$options['include_desktop']`
+ * is truthy, `@desktop` is included.
+ *
+ * @since 7.2.0
+ *
+ * @param mixed $viewport_settings Viewport settings from theme.json.
+ * @param array $options {
+ * Optional. Options for generating media queries.
+ *
+ * @type bool $include_desktop Whether to include the desktop media query. Default false.
+ * }
+ * @return array Responsive media queries.
+ */
+function wp_get_viewport_media_queries( $viewport_settings = null, $options = array() ) {
+ return WP_Theme_JSON::get_viewport_media_queries( $viewport_settings, $options );
+}
+
/**
* Gets the styles resulting of merging core, theme, and user data.
*
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 64107a9510..9d8830a084 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-63888';
+$wp_version = '7.2-alpha-63889';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.