Media files exist in upload folder but not showing up

Just by uploading files into the wp-content/uploads won’t show up in the Media Library , those media ID’s needs to be there in the database to show up in the Media Library. If you already have files in the uploads folder and want to add them into the database, you can use this plugin to … Read more

How to add new tab to media upload manager with custom set of images?

This is an old thread but for me still as still as relevant. I have been fiddling and has come up with this code for adding a media tab here, maybe someone want to continue for how the handle content for the tab? 🙂 add_action(‘admin_enqueue_scripts’, function(){ wp_enqueue_script( ‘my-media-tab’, plugin_dir_url( __FILE__ ) . ‘/js/mytab.js’, array( ‘jquery’ … Read more

Limit image upload to one and disable audio, video and other document file types to upload

I was about to give up thinking that it wasn’t possible or at least easy and then I stumbled onto the wp_handle_upload_prefilter filter which gives you exactly what you asked for! Here’s the code: add_filter(‘wp_handle_upload_prefilter’, ‘yoursite_wp_handle_upload_prefilter’); function yoursite_wp_handle_upload_prefilter($file) { // This bit is for the flash uploader if ($file[‘type’]==’application/octet-stream’ && isset($file[‘tmp_name’])) { $file_size = getimagesize($file[‘tmp_name’]); … Read more

How to generate thumbnails when needed only?

Take a look at Otto’s Dynamic Image Resizer plugin This plugin changes the way WordPress creates images to make it generate the images only when they are actually used somewhere, on the fly. Images created thusly will be saved in the normal upload directories, for later fast sending by the webserver. The result is that … Read more

wp_upload_dir how to get just the directory name .

This is what you get back from the function: Array ( [path] => C:\development\xampp\htdocs\example.com/content/uploads/2012/04 [url] => http://example.com/content/uploads/2012/04 [subdir] => /2012/04 [basedir] => C:\~\example.com/content/uploads [baseurl] => http://example.com/content/uploads [error] => ) So you can get the (as @OneTrickPony pointed out), folder/directory name with echo wp_basename( $uploads[‘baseurl’] ); If you’re running multisite and you defined the constant UPLOADS, … Read more

Can I upload media to a specific folder?

Go to Dashboard -> Settings -> Media Enter the desired location in Store uploads in this folder Uncheck Organize my uploads into month- and year-based folders This will specify the global upload location. To specify a per-file upload location, you’ll need to use a Plugin, such as WP Easy Uploader (not an endorsement, per se; … Read more

Physical organization of wordpress media library (Real Media Library plugin)

Free solution extension “Physical Custom Upload Folder” A long time ago I started to open this thread and now there is a usable extension plugin for Real Media Library which allows you to physically manage your uploads folder. Check out this plugin: https://wordpress.org/plugins/physical-custom-upload-folder/ Do you know the wp-content/uploads folder? There, the files are stored in … Read more

Trigger refresh for new media manager in 3.5

The correct way of refreshing the content of the frame, as found in the WP core, is as below: if(wp.media.frame.content.get()!==null){ wp.media.frame.content.get().collection.props.set({ignore: (+ new Date())}); wp.media.frame.content.get().options.selection.reset(); }else{ wp.media.frame.library.props.set({ignore: (+ new Date())}); } You should always check of the content is available, else refresh the library. Cheers!

Plupload Intergration in a meta-box?

My specifically how to collect a response from the plUpload jQuery object once it has uploaded the media that you want and how one would use the same functionality in a meta box to create a gallery? There’s a specific file that handles this functionality: /wp-includes/js/plupload/handlers.dev.js. This file contains all of the hooks and triggers … Read more

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