Make WordPress Core


Ignore:
Timestamp:
10/22/2018 07:57:07 PM (6 years ago)
Author:
danielbachhuber
Message:

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.

Props desrosj.
Fixes #45125.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/post-template.php

    r41583 r43790  
    721721    if ( has_custom_logo() ) {
    722722        $classes[] = 'wp-custom-logo';
     723    }
     724
     725    if ( current_theme_supports( 'responsive-embeds' ) ) {
     726        $classes[] = 'wp-embed-responsive';
    723727    }
    724728
Note: See TracChangeset for help on using the changeset viewer.