How to upload all media to one folder, with no year/month subfolders

Pop this tiny code snippet into a file located here: wp-content/mu-plugins/upload-dir.php (a must use plugin file). Create the mu-plugins directory if it does not exist already. <?php add_filter( ‘pre_option_uploads_use_yearmonth_folders’, ‘__return_zero’); What you’re doing here is filtering an option value at runtime, which is picked up internally by _wp_upload_dir() and therefore uploads are no longer nested … Read more

Add media attachment filter to custom wp.media frame

You need to make use of filterable property. To do that, you can extend the library and use that as a custom state. // Create state var myCustomState = wp.media.controller.Library.extend({ defaults : _.defaults({ id: ‘my-custom-state’, title: ‘Upload Image’, allowLocalEdits: true, displaySettings: true, filterable: ‘all’, // This is the property you need. Accepts ‘all’, ‘uploaded’, or … Read more

Image uploading stuck on “crunching”

Ok so i’m on wordpress 3.8.1 and i was having this issue and i tried EVERY FIX from every post i could find on this problem of the image upload staying stuck on “crunching” or having it say “image data does not exist” So apparently if the image dimensions (e.g. 1920×1080) are bigger than what … Read more

How to link to the image editor’s Edit Image function?

You may add the following scripts: wp_enqueue_script( ‘wp-ajax-response’ ); wp_enqueue_script(‘image-edit’); wp_enqueue_style(‘imgareaselect’); Maybe this already helps? I think the html in the front-end should be similar to the html in /wp-admin/media.php?attachment_id=…&action=edit

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