Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#38679 closed defect (bug) (fixed)

REST API: Media `caption` and `description` should have rendered/raw properties

Reported by: jnylen0's profile jnylen0 Owned by: rmccue's profile rmccue
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch has-unit-tests
Focuses: Cc:


Previously discussed at, but I believe the decision there is incorrect: attachments have a post page just like posts, and wpautop and other rendering filters are applied on this page. So we need to handle "content" (description) and "excerpt" (caption) the same way for attachments.

Props @miyauchi for getting this patch started.

Attachments (1)

38679.diff (10.1 KB) - added by jnylen0 8 years ago.

Download all attachments as: .zip

Change History (7)

8 years ago

#1 @swissspidy
8 years ago

  • Keywords has-patch has-unit-tests added

#2 @jnylen0
8 years ago

Also relevant here:

[With this patch], the rendered description for media items includes the <p class="attachment"> tag containing the attachment content itself. Perhaps the filters we apply to attachment description should be tweaked, and this should show up in the content property instead?

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

8 years ago

#4 @rmccue
8 years ago

  • Milestone changed from Awaiting Review to 4.7
  • Owner set to rmccue
  • Status changed from new to assigned

#5 @rmccue
8 years ago

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

In 39154:

REST API: Change attachment caption & description to objects.

Just like excerpt and content for regular posts, these have transformations applied that can make the content significantly different from the raw value.

Props jnylen0.
Fixes #38679.

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

7 years ago

Note: See TracTickets for help on using tickets.