Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)

I’ve had this same problem for ages and have currently landed on the following combination of plugins to resolve the issue: Media Tags Tag Gallery Cleaner Gallery Additionally, I made two modifications to the tag gallery plugin (to remove TimThumb and allow reverse ordering) This solution still has a lot of downsides including that it … Read more

Filter what image sizes get generated

Picking which image sizes to generate on a per-upload basis is definitely going to be a bit involved. However, if you’re okay with just entirely removing default image sizes, you have a couple of options, as described in this article: The simplest way is to set the default image height and width to ‘0’ at … Read more

Disable TinyMCE Drag and Drop

you can solve this problem by enqueue the following script with the dependency of jQuery jQuery(document).ready(function(){ tinyMCEPreInit.dragDropUpload = false; }); To add the dependency you can refer this link I have tested this solution and it has worked for me. I hope it will work for you too.

Filter Media Library by author or post_parent

The only way to do it is using a query filter I think function wpse156319_posts_where( $where, $query ) { global $wpdb; $where .= $wpdb->prepare( ‘ AND (‘ . $wpdb->posts . ‘.post_parent = %s OR ‘ . $wpdb->posts . ‘.post_author = %s)’, $_POST[‘id’], get_current_user_id() ); return $where; } which you just add in the ajax_query_attachments_args instead … Read more

Shortlink directly to a media file?

It turns out this is easily solved by creating a file attachment.php and redirecting to the file itself. Create an attachment.php file in your WordPress theme folder Put this code in the file <?php wp_redirect(wp_get_attachment_url(), 301); ?> Upload it and there you go This link explains in full.

How to validate the file name of the Media File Uploads?

The filter is sanitize_file_name. You get the $filename as parameter. Sample code: add_filter( ‘sanitize_file_name’, ‘wpse_77892_filter_filename’ ); function wpse_77892_filter_filename( $filename ) { return str_replace( ‘%’, ‘-‘, $filename ); } See my plugin Germanix URL for an extended example.

Extend 3.5 media uploader plugin to change button name

Figured it out using a different method. Help from here. $.fn.oeUpload = function(options) { // Set default options var defaults = { ‘preview’ : ‘.preview-upload’, ‘text’ : ‘.text-upload’, ‘button’ : ‘.button-upload’, ‘name’ : ‘Choose Image’ }; var options = $.extend(defaults, options); var uploader; $(options.button).click(function(e) { e.preventDefault(); //If the uploader object has already been created, reopen … Read more

Delete attachments from Front end

You can do it via ajax, first, let’s change your current function to this: <?php $args = array( ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_mime_type’ => ‘image’, ‘post_status’ => null, ‘numberposts’ => -1, ); $images = get_posts( $args ); $imagenum=0; foreach($images as $image): $imagenum++; ?> <div style=”width:110px; float:left;”> <?php … Read more