upload_async.php returns 500 error

It’s a bit of a shot in the dark, but would you like to move up your memory limit? My guess is that your uploader fails on uploading big files with more serious plugins on just because they are using some of the memory too. In some cases “Memory exhausted” message does not appear if … Read more

Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts

You have to change: ‘post_type’ => ‘post’, To: ‘post_type’ => ‘your_custom_post_type_name’, And a all the reference to standard post. Also, you should add the filters only for main query or you can end up with issues in secondary queries. Bellow an example code for gallery custom post type. I was trying to debug the code … Read more

WordPress Image Editor not working – conflict?

I have actually managed to resolve my own problem. For anyone else that might ever read this the problem which caused this was that my functions.php file had a closing ?> at the very end. For whatever reason this is what cause the issue and by removing this last line it was working again.

Rendering the uploaded file in a wp.media object

I presume you’ve fixed this already but (in a blatant attempt to snaffle the bounty and) as mentioned in the comments there’s a simple fix, in your myplugin_meta_box_callback() function change the line $mime_types = array( ‘application/pdf’ ); to $mime_types=”application/pdf”; The library.type option to wp.media expects a string (which can be comma-separated with additional types) not … Read more

WordPress 3.5: Switch back to Old Media Uploader?

I just found this gem in WordPress forums, all props to A.Morita. Is there a way to disable the new Media Manager? Summing up all the code published, this is it: /** * I WANT THE OLD UPLOADER BACK * All code by: A.Morita * URL: http://wordpress.org/support/topic/is-there-a-way-to-disable-the-new-media-manager/ */ /** * Old upload Thickbox */ add_action( … Read more

Set limit to media upload?

Yes, you can use the wp_handle_upload_prefilter that allows you to stop the uploading process if a specific condition is not accomplished. In your case, you could try this code snippet: function limit_upload_size( $file ) { // Set the desired file size limit $file_size_limit = 1024; // 1MB in KB // exclude admins if ( ! … Read more

Saving Media – Which Hook is Fired?

Actually there are no hook fired after media file(s) upload, at least as far as I know. The problem with the hooks available along the way of uploading and saving media files and data is that they are limited to one portion of the process, and so using any of them is not reliable. For … Read more

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