[wp-trac] [WordPress Trac] #41816: attachment_url_to_postid() should find post_id for URLs of intermediate size images

WordPress Trac noreply at wordpress.org
Thu Mar 4 04:20:26 UTC 2021


#41816: attachment_url_to_postid() should find post_id for URLs of intermediate
size images
-------------------------------------------------+-------------------------
 Reporter:  pbiron                               |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Media                                |     Version:  4.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback 2nd-opinion   |     Focuses:
  has-unit-tests                                 |
-------------------------------------------------+-------------------------

Comment (by celloexpressions):

 #51058 is a slightly different result of this same problem.
 `attachment_url_to_postid()` should be able to identify any WordPress-
 generated files that are related back to the same attachment post/file.
 Or, there should be a separate function that serves this purpose.

 There are several situations where plugins or themes are only able to
 access a single attachment-related URL (ex. one scaled image size), and
 they need to find the attachment ID to access other attachment data.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41816#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list