How can I stop WP media uploader from creating duplicates of my uploaded images?

I believe the following should stop thumbnails from being created. If you’re wanting to remove some then and unset the $size[{size}]. Following sizes are there “thumbnail”,”medium”,”large”,”post-thumbnail”. add_filter(‘intermediate_image_sizes_advanced’,’stop_thumbs’); function stop_thumbs($sizes){ return array(); }

Add size in Gallery Settings in Media Library

first +1 for the first commenter . NEVER CHANGE CORE FILES. this function will do the trick for your media upload : function dl_custom_image_sizes_add_settings($sizes) { unset( $sizes[‘thumbnail’]); //comment to remove size if needed //unset( $sizes[‘medium’]);// uncomment to remove size if needed //unset( $sizes[‘large’]);// uncomment to restore size if needed unset( $sizes[‘full’] ); // comment to … Read more

How to Check Disk Space used by Media Library

Using this StackOverflow Answer, I came up with a Dashboard Widget that displays the following: I extended the OP request for the uploads dir size (default or custom location) and added wp-content (default or custom), blogs.dir case in Multisite, and WordPress base dir. <?php /* Plugin Name: Folder Sizes Dashboard Widget Plugin URI: http://wordpress.stackexchange.com/q/67876/12615 Description: … Read more

How do I remove the entire Media section from the main WordPress navigation without just hiding it?

You are indeed correct, before the admin update(i imagine the UI redesign, etc), unsetting items from the menus would in effect prevent access to those pages, that’s clearly changed now and requires additional cap checking. This isn’t something i’ve looked into myself(as i’ve just found out this moment), so i can’t speak about methods for … Read more

Get the attachment URL on single.php

The the_attachment_link returns an HTML link, so use this code: if ( $attachments = get_children( array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => 1, ‘post_status’ => null, ‘post_parent’ => $post->ID ) ) ); foreach ( $attachments as $attachment ) { echo wp_get_attachment_link( $attachment->ID, ” , true, false, ‘Link to image attachment’ ); } Here … Read more

Add new media uploader at frontend for wp 3.5+

Add this code to your theme’s functions.php file: function add_media_upload_scripts() { if ( is_admin() ) { return; } wp_enqueue_media(); } add_action(‘wp_enqueue_scripts’, ‘add_media_upload_scripts’); This will cause the the media upload files to load on your front end pages. If you would like to load them only on one specific page where they will be needed, you … Read more

Inserting a Download Link in the Quick Edit Actions of the Media Library?

Modified version of a piece of code found in this tutorial. add_filter(‘media_row_actions’, ‘wpse_30159_qe_download_link’, 10, 2); function wpse_30159_qe_download_link($actions, $post) { /* Almost sure this is not necessary. Just in case… */ global $current_screen; if ( ‘upload’ != $current_screen->id ) return $actions; // if not PDF file, return default $actions if ( ‘application/pdf’ != $post->post_mime_type ) return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)