Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45125 closed feature request (fixed)

Add theme support for responsive embeds

Reported by: desrosj's profile desrosj Owned by: danielbachhuber's profile danielbachhuber
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch has-unit-tests fixed-5.0
Focuses: rest-api Cc:

Description

In the new editor, the concept of responsive embeds is introduced.

Relevant Issue: https://github.com/WordPress/gutenberg/issues/10109

Relevant PR: https://github.com/WordPress/gutenberg/pull/10477

WordPress Core should be updated to indicate this new theme feature.

Attachments (1)

45125.diff (6.0 KB) - added by desrosj 6 years ago.

Download all attachments as: .zip

Change History (13)

#1 @desrosj
6 years ago

@notnownikki The main item here is to update add_theme_support() to indicate responsive-embeds is an accepted value. It may also be appropriate to be accompanied by a dev-note, but it could also be noted within another post.

@desrosj
6 years ago

#2 @desrosj
6 years ago

  • Focuses rest-api added; docs removed
  • Keywords has-patch has-unit-tests needs-refresh added; needs-patch removed

45125.diff contains all responsive embed related code in Gutenberg, except:

  • The admin body classes. This class is added along with several others but is dependant on is_gutenberg_page(), which will be one of the last things to be committed.
  • The block-library package needs to have its version bumped to 2.1.2. I am seeing the following error when running npm install locally, currently:

Could not install from "node_modules/@wordpress/autop" as it does not contain a package.json file.

Also of note, I included the code modifying the themes REST API endpoint I originally posted on #45016. Going to note that there next.

This ticket was mentioned in Slack in #core-restapi by desrosj. View the logs.


6 years ago

This ticket was mentioned in Slack in #core-js by desrosj. View the logs.


6 years ago

This ticket was mentioned in Slack in #core-restapi by danielbachhuber. View the logs.


6 years ago

#6 @swissspidy
6 years ago

@desrosj FYI These package.json errors have been resolved in the meantime

#7 @desrosj
6 years ago

  • Keywords commit added; needs-refresh removed

Thanks, @swissspidy!

Looked through this again today. This can be landed.

The is_gutenberg_page() function was added in [43777], and the needed body classes were committed in [43780].

The issue with packages was resolved, and the block-library package now meets the minimum required version for this change (see [43789]).

Just noting that when this lands, the patch on #45134 will need to be refreshed.

#8 @danielbachhuber
6 years ago

  • Owner set to danielbachhuber
  • Resolution set to fixed
  • Status changed from new to closed

In 43790:

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.

#9 @danielbachhuber
6 years ago

  • Keywords fixed-5.0 added; commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for merge to trunk.

#10 @ocean90
6 years ago

In 43791:

Themes: Remove a stray slash and gutenberg text domain.

See #45125.

This ticket was mentioned in Slack in #core by robincornett. View the logs.


6 years ago

#12 @jeremyfelt
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44138:

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.

Note: See TracTickets for help on using tickets.