• I’ve set up a website for county departments to post their own information to the county website. Things are pretty good, except people repeatedly post links to PDFs and the like using the “Attachment Post URL” button instead of straight to the file URL.

    I’ve found a way to remove this button in the media.php file under wp-admin\includes, but I really don’t want to modify a core wordpress file.

    Is there a way to disable or hide this button without changing core wordpress files? If so, what file do I need to modify, and what do I need to change?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I would also like to know how to remove the “Attachment Post URL” button– there’s no reason that anyone on my site should click anything but “none” or “File” for the attachment link, yet for some reason a lot of people click “Attachment” and screw up our highslide/lightbox script :\

    me too! anyone?

    I have “fixed” this issue by simply hiding that button using a style.

    I define a file admin.css which is loaded only when I’m in the Admin panel

    In file:
    functions.php:

    if (is_admin()) {

    /**
    * Register my own admin.css for adding new styles
    * Adds the function ‘add_my_stylesheet’ to the
    * wp_enqueue_scripts action.
    */
    function add_admin_stylesheet() {

    echo ‘<link rel=”stylesheet” href=”‘ . get_bloginfo(‘stylesheet_directory’) . ‘/css/admin.css” type=”text/css” />’;
    }
    add_action( ‘admin_print_styles’, ‘add_admin_stylesheet’ );

    }

    In file:
    css/admin.css:

    # Hide the “Attachment Post URL” from the Media Gallery
    .urlpost {

    visibility: hidden;
    }

    Hope this helps!

    Sorry, replace the comment

    # Hide the “Attachment Post URL” from the Media Gallery

    with

    /* Hide the “Attachment Post URL” from the Media Gallery */

    Or if not it comments also the css below

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘remove "Attachment Post URL" button from media upload’ is closed to new replies.