WordPress.org

Ready to get started?Download WordPress

Forums

remove "Attachment Post URL" button from media upload (5 posts)

  1. cowley_mis
    Member
    Posted 2 years ago #

    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!

  2. metalmusicman
    Member
    Posted 1 year ago #

    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 :\

  3. lyndonr
    Member
    Posted 1 year ago #

    me too! anyone?

  4. leoloso
    Member
    Posted 1 year ago #

    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!

  5. leoloso
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.