If you actually wanted to remove it instead of just hiding it you could remove the ‘admin-gallery’ script that is used to insert the gallery settings form. And if you wanted it to be remove only for non-admins then something like this should work:
function disable_wp_gallery()
{
if( !current_user_can('manage_options') )
wp_deregister_script('admin-gallery');
}
add_action('admin_enqueue_scripts', 'disable_wp_gallery');
Related Posts:
- Detect if is image unattached
- Retrieving a custom link on an attachment
- how to test for attached image
- Gel all image from certain post type
- ID of images from gallery
- Getting attachment images is cloning some of them
- How to make a customized “Create Gallery” tab in the ‘Add Media’ window?
- Reorder “menu order” of attachments to another predefined order
- Add image attachment to post via coding?
- Ordering of gallery images without using shortcode in theme
- Custom Gallery HTML only working when images are attached to post/page
- Display random gallery images and its parent post title leading to parent post permalink
- Where does the gallery shortcode gets its attachments from?
- hide attached images of a post
- WordPress Gallery Permalink Structure Displaying Incorrectly
- How do I get just the title from wp_get_attachment_image
- changing the default picture size link url
- Programmatically Altering Gallery Link and image size?
- How is it possible that a gallery doesn’t have attachment ids?
- ID of images from gallery
- How to save media-form on custom tab
- Gallery Thumbnail Layout Template
- How to manage attachment relationships for specific posts in WP 3.5+
- Change attachment filename
- Getting a taxonomy’s thumbnail url
- Check if post has attachments (not image)
- Expanding new Media Uploader in WordPress 3.5
- Applying automatic link class to images embedded to posts
- How to get attachment caption (get_the_excerpt gives parent post excerpt) ?
- How to single click to download image in single post
- delete attachment from front end
- custom fields for attachments?
- URL rewrite with add_rewrite_rule and attachment_id
- How to set author for post AND post attachments
- Get attachment from post
- Add column for attachment file size
- Change image link: wp_get_attachment_link
- Multi-line captions on attachments
- Making images from single.php pointing to an attachment .php template
- wp_get_attachment_image_src always returns false
- Exact image sizes
- Get the size (size in Kb or MB) of an featured image?
- Adding attachment file name to email link
- How to allow specific extensions and file size to wp_mail attachment?
- Get attachment file link
- How to grab the first two image attachments from a post?
- wp_insert_post featured image from library
- the_content() behavior on attachment.php versus single.php
- attachments with tags and get_posts
- Disable edit media attachments?
- Getting ID from ajax response of async-upload.php
- Post Auto Draft Issue
- post_author for wp_insert_attachment
- Adding width and height to wp_get_attachment_image_src
- Get the bare URL for an attachment
- Don’t show attachments if they are inserted in post
- Exclude images from “inserted into post” when trying to get attachments
- attachment.php code or tutorial
- Control attachments menu order with jQuery Sortable
- Media library quick/inline edit
- Email Attachment from Form Submit
- Check what attached image size is used
- Custom image sizes add to metadata
- How do you create an attachment ID with Ajax submit? No page refresh
- How to get $attachment->ID in custom functions
- All attachment pages give 404
- Unable to get wp_get_attachment_url to show
- Get Attachment Image Class by attachment id
- has_excerpt yields true but no post_excerpt when retrieved
- Automatically deactivate link for attachments
- Hiding or removing file extension displayed in HTML on attachment page
- After changing permalink structure, How to redirect attachment url to old parent post url
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Getting attachment post using wp_get_attachment_link
- wp_mail Allow Remote Attachments from CDN
- Were attachment media settings removed from WordPress?
- How to identify and delete all the images/pdf’s which are not assigned to any post/custom-post/page and also which are repeated
- Filter not applied to all image sizes
- Zip a file and add as attachment
- Nothing found in uploads folder after wp_insert_attachment
- Remove post with attachments hook
- Setting an image as post header (not featured image)
- PHPMailer – Uploading a file
- How to restrict users to only access their own media files in wordpress
- wp_mail doen’t send mails whit attachment
- Create a Gallery and update Post Parent of Attachment Images
- When inserting attachments into a blog post, how can I get WordPress to use the full filename with the extension?
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- List attachments of a page
- attachment.php & flexslider—linking thumbnail to specific image
- Importing Attachments with No Extension
- Is there a way to add Reattach and Unattach links in image gallery?
- Post images not displaying as attachments
- How to retrieve images contained in a post
- wp_get_attachment_link() add rel attribute if the link points to direct image
- Showing the attachment for a page?
- How can we select attachements based on Caption?
- Calling a javascript function in post edit page after attaching something to post
- Custom Fields, Media uploader, Attachments
- Change the next thumbnail to text