Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#32074 closed defect (bug) (fixed)

get_image_send_to_editor() improperly documented

Reported by: tychay Owned by: wonderboymusic
Priority: normal Milestone: 4.4
Component: Media Version: 4.1
Severity: normal Keywords:
Cc: Focuses: docs

Description

​https://developer.wordpress.org/reference/functions/get_image_send_to_editor/#source-code

https://core.trac.wordpress.org/browser/tags/4.1/src/wp-admin/includes/media.php#101

$rel does not support string input as written. Either change the documentation on line 112 to be bool only, or change line 120 to read

<?php
        if ( !$rel || !is_string($rel) ) {
                $rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
        } else {
                $rel = ' rel="' . esc_attr($rel).'"';
        }

or…

<?php
        if ( !$rel || !is_string($rel) ) {
                $rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
        }

depending on what the doc means (it's not clear).

Attachments (1)

32074.diff​ (1.7 KB ) - added by wonderboymusic 11 years ago.

Download all attachments as: .zip

Change History (6)

This ticket was mentioned in ​Slack in #docs by tychay. ​View the logs.


11 years ago

#2 @DrewAPicture
11 years ago

  • Focuses docs added

Hi @tychay, would you like to try your hand at creating a patch?

#3 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → closed

In 34259:

Media: In get_image_send_to_editor(), allow a custom value for $rel.

Props tychay.
Fixes #32074.

#4 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review → 4.4

#5 @helen
11 years ago

In 35760:

Media: Avoid rel="rel=" situations.

props lucymtc, swissspidy.
fixes #34826. see #32074.

Note: See TracTickets for help on using tickets.