WordPress.org

Ready to get started?Download WordPress

Forums

Insert into Post button missing for some picture (7 posts)

  1. misthero
    Member
    Posted 3 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??

  2. johanl
    Member
    Posted 3 years ago #

    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

  3. misthero
    Member
    Posted 3 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.

  4. ruijt
    Member
    Posted 3 years ago #

    this works for me!

  5. stevebluck
    Member
    Posted 3 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?

  6. Kruncher
    Member
    Posted 2 years ago #

    I ran into problems by negating $send, instead I had to remove the condition altogether.

    if ( $send )

  7. Brian Fegter
    Member
    Posted 2 years 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;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic