Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#32074 closed defect (bug) (fixed)

get_image_send_to_editor() improperly documented

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

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 10 years ago.

Download all attachments as: .zip

Change History (6)

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


10 years ago

#2 @DrewAPicture
10 years ago

  • Focuses docs added

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

#3 @wonderboymusic
10 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 34259:

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

Props tychay.
Fixes #32074.

#4 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.4

#5 @helen
9 years ago

In 35760:

Media: Avoid rel="rel=" situations.

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

Note: See TracTickets for help on using tickets.