[wp-trac] [WordPress Trac] #36084: Link to media images now get a rel=attachment

WordPress Trac noreply at wordpress.org
Thu Mar 17 01:51:08 UTC 2016


#36084: Link to media images now get a rel=attachment
--------------------------------------+------------------------
 Reporter:  csschris                  |       Owner:  joemcgill
     Type:  defect (bug)              |      Status:  accepted
 Priority:  normal                    |   Milestone:  4.5
Component:  Media                     |     Version:  4.4.2
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------

Comment (by joemcgill):

 Replying to [comment:16 azaozz]:
 > Thinking more about this: we've supported a string for `$rel` in
 `get_image_send_to_editor()` for a while. Removing it now may eventually
 break some plugin...
 >

 The main advantage I see in [attachment:36084.5.diff] over
 [attachment:36084.3.diff] is the validation that `$rel` is a string,
 otherwise, I don't see much benefit over [attachment:36084.3.diff] since
 functionally, we're building an identical default `$rel` attribute in
 `wp_ajax_send_attachment_to_editor()` before converting to a (bool) when
 calling `get_image_send_to_editor()`.

 If we needed to support a fallback case when someone passes `true` to the
 `$rel` param in `get_image_send_to_editor()` I suspect we would have heard
 about it when changed that behavior in [34259].

 My preference currently would be to keep the changes introduced last
 cycle, and do [attachment:36084.3.diff] with an added sanity check to make
 sure the value is a string. The logic seems more straightforward to me and
 removes the confusing redundancy that existed before [34259] (et al.).

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


More information about the wp-trac mailing list