4

Looking for a way to disable the "Edit Image" option. I would still like to be able to edit the description, alt, etc. But remove the Edit image button or disable that image editor. Thanks,

3 Answers 3

2

I figured it out. Just put this in your functions.php file

add_action('admin_head-media-upload-popup', 'remove_edit_image_button'); // for the pop up media box
add_action('admin_head', 'remove_edit_image_button'); // for the media page

function remove_edit_image_button()
{
?>
<style>
    .A1B1 p .button
    {
        display:none;
    }
</style>
<?php
}
0

The CSS selectors above didn't work for me; however, after inspecting the page I came up with this, which did work:

function remove_edit_image_button()
{
    ?>
    <style>
        .wp_attachment_image p .button
        {
            display:none;
        }
    </style>
<?php
}

Could be due to another plugin I'm using, or a different WP version, I don't know.

Just posting in case someone else encounters this.

1
  • This is partial answer. Only hide. User still can build url by hand and edit image.
    – Marcin
    Oct 8, 2014 at 19:55
0

From Disable edit option in Media library:

Add some CSS to admin_head to hide the image actions bar, and hide the edit button once clicking into the image:

This should do the trick:

function hide_image_edit_link() {
    echo '<style>
        table.media .row-actions {display:none;}
        .wp_attachment_image input[id^="imgedit-open-btn"] {display:none;}
    </style>';
}
add_action('admin_head', 'hide_image_edit_link');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.