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/tests/phpunit/tests/theme/support.php

    r39919 r43790  
    192192        $this->assertFalse( current_theme_supports( 'menus' ) );
    193193    }
     194
     195    /**
     196     * @ticket 45125
     197     */
     198    function test_responsive_embeds() {
     199        add_theme_support( 'responsive-embeds' );
     200        $this->assertTrue( current_theme_supports( 'responsive-embeds' ) );
     201        remove_theme_support( 'responsive-embeds' );
     202        $this->assertFalse( current_theme_supports( 'responsive-embeds' ) );
     203        add_theme_support( 'responsive-embeds' );
     204        $this->assertTrue( current_theme_supports( 'responsive-embeds' ) );
     205    }
    194206}
Note: See TracChangeset for help on using the changeset viewer.