[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
Wed Feb 20 22:28:41 UTC 2019


#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 pbiron):

 Replying to [comment:7 leodandesign]:
 > I've implemented a very simple solution that uses preg_replace to remove
 the dimension element of the url and then run the
 attachment_url_to_postid() function.

 Unfortunately, that approach can fail (badly), see
 [[https://core.trac.wordpress.org/ticket/42437|#42437]].

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


More information about the wp-trac mailing list