diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 8219b27f69..4c0fed2b90 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -760,6 +760,10 @@ function get_body_class( $class = '' ) { $classes[] = 'wp-custom-logo'; } + if ( current_theme_supports( 'responsive-embeds' ) ) { + $classes[] = 'wp-embed-responsive'; + } + $page = $wp_query->get( 'page' ); if ( ! $page || $page < 2 ) { diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php index 4aa7db4f6f..dbfaa839cb 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php @@ -111,8 +111,9 @@ class WP_REST_Themes_Controller extends WP_REST_Controller { $formats = array_merge( array( 'standard' ), $formats ); $data['theme_supports']['formats'] = $formats; - $data['theme_supports']['post-thumbnails'] = false; - $post_thumbnails = get_theme_support( 'post-thumbnails' ); + $data['theme_supports']['post-thumbnails'] = false; + $data['theme_supports']['responsive-embeds'] = (bool) get_theme_support( 'responsive-embeds' ); + $post_thumbnails = get_theme_support( 'post-thumbnails' ); if ( $post_thumbnails ) { // $post_thumbnails can contain a nested array of post types. @@ -156,16 +157,21 @@ class WP_REST_Themes_Controller extends WP_REST_Controller { 'type' => 'array', 'readonly' => true, 'properties' => array( - 'formats' => array( + 'formats' => array( 'description' => __( 'Post formats supported.' ), 'type' => 'array', 'readonly' => true, ), - 'post-thumbnails' => array( + 'post-thumbnails' => array( 'description' => __( 'Whether the theme supports post thumbnails.' ), 'type' => array( 'array', 'bool' ), 'readonly' => true, ), + 'responsive-embeds' => array( + 'description' => __( 'Whether the theme supports responsive embedded content.' ), + 'type' => 'bool', + 'readonly' => true, + ), ), ), ), diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 3d26800436..ee84c031f4 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -2318,12 +2318,14 @@ function get_theme_starter_content() { * @since 4.1.0 The `title-tag` feature was added * @since 4.5.0 The `customize-selective-refresh-widgets` feature was added * @since 4.7.0 The `starter-content` feature was added + * @since 5.0.0 The `responsive-embeds` feature was added. * * @global array $_wp_theme_features * * @param string $feature The feature being added. Likely core values include 'post-formats', * 'post-thumbnails', 'html5', 'custom-logo', 'custom-header-uploads', - * 'custom-header', 'custom-background', 'title-tag', 'starter-content', etc. + * 'custom-header', 'custom-background', 'title-tag', 'starter-content', + * 'responsive-embeds', etc. * @param mixed $args,... Optional extra arguments to pass along with certain features. * @return void|bool False on failure, void otherwise. */ diff --git a/wp-includes/version.php b/wp-includes/version.php index 56090f2a0f..290e1612d6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44137'; +$wp_version = '5.1-alpha-44138'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.