No Thumbnails Generated
I figured it out! In my php.ini file I had to uncomment extension=php_gd2.dll, then it started working after I rebuilt the images I uploaded 🙂 Thanks, Josh
I figured it out! In my php.ini file I had to uncomment extension=php_gd2.dll, then it started working after I rebuilt the images I uploaded 🙂 Thanks, Josh
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
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
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
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
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
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
you can write a php script, or make your own plugin of this code here, i used it in one of my projects where i had to import a large number of images. first, get the image, and store it in your upload-directory: $uploaddir = wp_upload_dir(); $uploadfile = $uploaddir[‘path’] . “https://wordpress.stackexchange.com/” . $filename; $contents= file_get_contents(‘http://mydomain.com/folder/image.jpg’); … Read more
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!
I put the following code into my functions.php file. It works! add_filter( ‘wp_image_editors’, ‘change_graphic_lib’ ); function change_graphic_lib($array) { return array( ‘WP_Image_Editor_GD’, ‘WP_Image_Editor_Imagick’ ); } When this helps it is because it changes the PHP code module used for processing the uploaded image for use with WordPress. This processing includes moving the image into the media … Read more