Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#19696 closed enhancement (fixed)

Allow to change the "Insert into post" button

Reported by: pedrogas_g's profile pedrogas_g Owned by:
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.3
Component: Upload Keywords:
Focuses: Cc:

Description

You can change in the wp-admin/includes/media.php line 1143


if ( $send )
		$send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false );

to something like this


if ( $send )
		$send = apply_filters('add_media_button',get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false ),$send,$attachment_id,$attachment_url);

to allow use the upload in any kind of sitution thanks.

Attachments (2)

media.php.zip (17.7 KB) - added by pedrogas_g 13 years ago.
The file with the modification
media.php.patch (1.3 KB) - added by pedrogas_g 13 years ago.
patch

Download all attachments as: .zip

Change History (12)

@pedrogas_g
13 years ago

The file with the modification

#1 follow-up: @kawauso
13 years ago

Submitting patches: Windows / *nix

#2 follow-up: @scribu
13 years ago

  • Type changed from feature request to enhancement

Something like this is definitely needed, but I'm not sure if a filter on that single button is enough.

#3 @scribu
13 years ago

  • Summary changed from Allow to change de the Insert to post button to Allow to change the "Insert into post" button

#4 @ocean90
13 years ago

Related: #17580

@pedrogas_g
13 years ago

patch

#5 in reply to: ↑ 1 @pedrogas_g
13 years ago

Replying to kawauso:

Submitting patches: Windows / *nix

Thanks I'm really new in wordpress

#6 in reply to: ↑ 2 @pedrogas_g
13 years ago

Replying to scribu:

Something like this is definitely needed, but I'm not sure if a filter on that single button is enough.

Well that single button was the only missing link to me, for the reste some custom url in tb_show, the "get_media_item_args" and "image_size_names_choose" filters and a little bit of js will do the job, but i'm still learning wordpress maybe there was something i mising.

#7 follow-up: @alex-ye
13 years ago

Also It would be a very good idea , if we allow to insert the content from thickbox window to a specfic text area either the default editor .

#8 in reply to: ↑ 7 ; follow-up: @pedrogas_g
13 years ago

Replying to alex-ye:

Also It would be a very good idea , if we allow to insert the content from thickbox window to a specfic text area either the default editor .

You can insert the content wherever you want, you only need to overwrite the send_to_editor function.

#9 in reply to: ↑ 8 @alex-ye
13 years ago

Replying to pedrogas_g:

Replying to alex-ye:

Also It would be a very good idea , if we allow to insert the content from thickbox window to a specfic text area either the default editor .

You can insert the content wherever you want, you only need to overwrite the send_to_editor function.

I know that but I want to make it possible thing using PHP only , this will be easier . By the way there is a way to change the "Insert into post" button using JavaScript too , see:

https://github.com/farinspace/wpalchemy/blob/dev/wp-content/wpalchemy/MediaAccess.php

#10 @koopersmith
12 years ago

  • Keywords has-patch needs-codex dev-feedback removed
  • Milestone changed from Awaiting Review to 3.5
  • Resolution set to fixed
  • Status changed from new to closed

The new media workflows allow for this — see the media_view_strings filter and #21092.

Note: See TracTickets for help on using tickets.