Themes: Introduce responsive embeds support.

Responsive embeds is a way for a theme to opt in to WordPress dynamically scaling the width/height of an embed. When a theme supports responsive embeds, a `wp-embed-responsive` class is added to the `<body>` tag. This information is also presented through the REST API for clients to respect.

Merges [43790] and [43791] from the 5.0 branch to trunk.

Props desrosj, danielbachhuber, ocean90.
Fixes #45125.


git-svn-id: https://develop.svn.wordpress.org/trunk@44138 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt
2018-12-14 01:49:46 +00:00
parent 3f8768a577
commit 82b3fac279
5 changed files with 60 additions and 6 deletions

View File

@@ -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.
*/