Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22544 closed defect (bug) (fixed)

Insert Media: Non-image attachments aren't inserted with a link

Reported by: ocean90's profile ocean90 Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

  • Upload a PDF file
  • Select Linkt to and use one of the options, for example Media File
  • Click Insert into post

Only the title will be inserted, the link around the text is missing.

http://wordpress.org/support/topic/new-media-insert-only-images-work-no-other-files-like-pdfs-etc?replies=1

Attachments (1)

22544.diff (769 bytes) - added by koopersmith 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @koopersmith
12 years ago

Confirmed.

@koopersmith
12 years ago

#2 @koopersmith
12 years ago

  • Keywords has-patch added; needs-patch removed

Define $_POST['url'] for non-image attachments in wp.media.editor.send.attachment().

#3 @nacin
12 years ago

Looking at this, I think we should go back to the old field names used by media_upload_form_handler() — align, image_alt, image-size, post_excerpt, post_title. Here's a patch that does that while fixing both this ticket and #22553.

Sidenote: $_POST['attachment']['url'], not $_POST['url'].

#4 @nacin
12 years ago

  • Keywords commit added

#5 @ryan
12 years ago

An empty line is inserted with 22553.diff. 22544.diff works. (Chrome, Mac OS)

#6 @nacin
12 years ago

  • Keywords dev-reviewed added

Will handle the other stuff in #22553.

#7 @nacin
12 years ago

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

In 22835:

Media: Include the link URL when inserting non-image attachments. props koopersmith. fixes #22544.

Note: See TracTickets for help on using tickets.