Regenerate thumbnails after upload
Adding $attach_data = wp_generate_attachment_metadata( $attach_id, $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); after $attach_id = wp_insert_attachment( $attachment, $filename); Fixed it.
Adding $attach_data = wp_generate_attachment_metadata( $attach_id, $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); after $attach_id = wp_insert_attachment( $attachment, $filename); Fixed it.
There is media_handle_sideload() function in core meant for processing files not uploaded through media interface. It’s not exactly what you need since it assumes file is outside of uploads and needs to be moved there as part of process, but it should give you and idea on generating and inserting it as valid attachment.
If you are using custom front-end registration through wp_signon function, check, if the second parameter, passed to that function is true: $user_signon = wp_signon( $info, true ); ). The second parameter tells WordPress to set the secure cookie for login. It works fine with SSL.
When the thickbox gets closed it triggers ‘tb_unload’ (in earlier WordPress version it was just ‘unload’ (not sure though) ) So you can do something like: $(window).bind(‘tb_unload’, function() { //do stuff });
You can disable tabs using a filter hook. Replace wpse_76095_isOurMediaUpload() with however you determine that you’re running the media popup. add_filter(‘media_upload_tabs’, ‘wpse_76095_filterMediaUploadTabs’); /** * filter out unwanted media upload tabs * @param array $tabs * @return array */ function wpse_76095_filterMediaUploadTabs($tabs) { if (wpse_76095_isOurMediaUpload()) { unset( $tabs[‘type_url’], // no linking from external sites (no local image) … Read more
You get just the file names because you are not uploading the files. Uploading files using AJAX is currently not that easy. Newer browsers implement the FormData interface, but for older browsers you’re stuck with some kind of flash uploader, like PlUpload for example. I suggest you use PlUpload because it’s bundled with WP, and … Read more
Its not possible unless you modify the core. File: wp-admin/includes/image-edit.php line number 28 in wp_image_editor function $sizer = $big > 400 ? 400 / $big : 1; line number 346 function _image_get_preview_ratio($w, $h) { $max = max($w, $h); return $max > 400 ? (400 / $max) : 1; } This function is responsible for small … Read more
So I discovered the answer after reading through my question after I posted it…. The htaccess rules need to go BEFORE the WordPress rules There you have it. That was the problem this entire time. I’m going to bed.
In my case the cause was plugin All In One WP Security an its “Basic Firewall Settings”. The above firewall features are applied via your .htaccess file and one if these features is “Limit file upload size (10MB).” So to make upload of files larger then 10 MB working again you can do following: 1) … Read more
Since version 3.5 you can define constant ‘UPLOADS’ like: define(‘UPLOADS’,’myfiles’); where ‘myfiles’ is a folder location relative to ABSPATH. If the folder does not exist, it will be automatically created. EDIT: It will only work, if a new folder is located below website’s Document Root folder ( ABSPATH ). To put it outside of ABSPATH … Read more