misthero
Member
Posted 2 years ago #
I have recently met a problem, I'm creating a template for a client and he is uploading pictures using the media library, the problem is that I cannot "insert into post" images he uploaded...
I have default administrator rights...
this is what happens
SCREENSHOT
I have the "insert into post button" if I upload a picture myself, but the button is missing for images he uploads...
Any hint??
I have had the same problem even though I'm the only one uploading images.
I found that a code snippet in wp-admin/includes/media.php looks a bit strange...
I changed
if ( $send )
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
to
if ( ! $send )
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
And it started working again.
Not sure if this is the correct way to go though...
best regards Johan
misthero
Member
Posted 2 years ago #
thank you johanl for your answer, great finding!
I'll try that, even if I hope to get a cleaner solution since changing wp core files will cause to lose those changes everytime wordpress is updated.
stevebluck
Member
Posted 2 years ago #
I'm also having a problem with the this button not showing up, is it possible to fix without editing the core files?
Kruncher
Member
Posted 1 year ago #
I ran into problems by negating $send, instead I had to remove the condition altogether.
if ( $send )
Brian Fegter
Member
Posted 1 year ago #
You can force this to be on without hacking the core:
add_filter( 'get_media_item_args', 'force_send' );
function force_send($args){
$args['send'] = true;
return $args;
}