mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user