[wp-trac] [WordPress Trac] #33277: Misleading comment for wp_get_attachment_link function

WordPress Trac noreply at wordpress.org
Wed Aug 5 15:23:51 UTC 2015


#33277: Misleading comment for wp_get_attachment_link function
--------------------------+------------------------------
 Reporter:  several27     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.2.3
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  docs
--------------------------+------------------------------

Comment (by several27):

 Replying to [comment:1 SergeyBiryukov]:
 > Hi @several27, welcome to Trac and thanks for the report!
 >
 > Introduced in [27473]. We could probably just remove the `intval()` and
 let `get_post()` handle the value.
 >
 > Would you like to try submitting a patch?

 I just verified it and just removing `intval()` won't work, line 1546:
 will have to be changed also:

 {{{
 $link_text = wp_get_attachment_image( $id, $size, $icon, $attr );
 }}}
 to
 {{{
 $link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr );
 }}}

 And after that it should work (at least is working for me).

 So how should I submit a patch?

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


More information about the wp-trac mailing list