Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#50722 closed enhancement (fixed)

Change params on wp_image_file_matches_image_meta function

Reported by: spacedmonkey Owned by: SergeyBiryukov
Priority: normal Milestone: 5.5
Component: Media Version: 5.5
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses: rest-api

Description

Change params on wp_image_file_matches_image_meta function for better reusability and more context to the filter.

Change History (6)

This ticket was mentioned in PR #423 on WordPress/wordpress-develop by spacedmonkey.


6 years ago
#1

  • Keywords has-unit-tests added

#2 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review5.5

#3 @spacedmonkey
6 years ago

The filter wp_image_file_matches_image_meta being passed the $attachment_id is important for plugins like jetpack that have custom image urls.

#4 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Status newreviewing

If the goal is to provide pass the $attachment_id parameter to the wp_image_file_matches_image_meta filter, it seems like the best way forward would be to pass it along with $image_meta to the function.

That would be consistent with a few existing functions:

  • wp_calculate_image_srcset()
  • wp_calculate_image_sizes()
  • wp_image_add_srcset_and_sizes()

#5 @SergeyBiryukov
6 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 48547:

Media: Pass the attachment ID to the wp_image_file_matches_image_meta filter.

Props spacedmonkey.
Fixes #50722.

Note: See TracTickets for help on using tickets.