WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#34523 closed defect (bug) (fixed)

Embeds: Make function parameters more clear

Reported by: swissspidy Owned by: SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: Embeds Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

As raised in the comments on the dev post:

The first param ($post) of get_post_embed_html() and get_oembed_response_data() is optional, the others are required. We should change the order of the params.

Patch attached.

Attachments (2)

34523.diff (8.8 KB) - added by swissspidy 6 years ago.
34523.2.diff (5.2 KB) - added by swissspidy 6 years ago.

Download all attachments as: .zip

Change History (7)

@swissspidy
6 years ago

@swissspidy
6 years ago

#1 @swissspidy
6 years ago

get_oembed_response_data() is called by the API endpoint controller and never in a context where it makes sense to use the global post object.

Therefore, 34523.2.diff only changes the param order for get_post_embed_html() and does correctly so by not forgetting the embed template.

#2 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
6 years ago

In 35470:

Embeds: Fix typo in oembed_request_post_id filter DocBlock.

Props swissspidy.
See #34523.

#4 @SergeyBiryukov
6 years ago

In 35471:

Embeds: In get_oembed_response_data(), make the $post argument required.

get_oembed_response_data() is called by the API endpoint controller and never in a context where it makes sense to use the global post object.

Props swissspidy.
See #34523.

#5 @SergeyBiryukov
6 years ago

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

In 35472:

Embeds: In get_post_embed_html(), move the optional $post argument after the required $width and $height.

Props swissspidy.
Fixes #34523.

Note: See TracTickets for help on using tickets.