Manipulating Media uploader

what i ended up doing was launching the thickbox uploaded manually via a jquery click event. then with setInterval i was able to hide the pieces i wanted. jQuery(document).ready(function($) { $(‘.specialclass’).click(function() { //get post id from somewhere (for me this was the row column string = $(this).parents(‘tr.type-portfolio’).attr(‘id’); if(/post-(\d+)/.exec(string)[1]) post_id = parseInt(/post-(\d+)/.exec(string)[1], 10); tbframe_interval = setInterval(function() … Read more

Way to force media uploader use custom image size

When calling add_filter( ‘image_size_names_choose’, ‘custom_image_sizes_choose’ ); use your investigative skills to see how it would be best to call an if(thisweretrue) add_filter( ‘image_size_names_choose’, ‘custom_image_sizes_choose’ ); since I don’t know exactly what your specific situation is. I actually was able to use your solution for setting up the custom sizes to help out with what I … Read more

Media Uploader: get deleted files

Without seeing your “list editor” code I can only provide a theoretical answer. when a file is deleted in the media uploader, I also want it removed from the list the user is currently editing, so the files can’t be saved to my custom database table when it no longers exists in the “media environment”. … Read more

Sharding BLOGUPLOADDIR

Copy the body of wp-includes/ms-settings.php into sunrise.php, from line 25 to line 127. At the bottom, add your BLOGUPLOADDIR defines. // from ms-settings.php ms_subdomain_constants(); if ( !isset( $current_site ) || !isset( $current_blog ) ) { // [trimmed, but you need the whole if block] } // end of ms-settings.php copy if ( $current_blog->blog_id < 10 … Read more

upload_mimes filter has no effect

I would use: add_filter( ‘upload_mimes’, ‘theme_restrict_mime_types’ ); function theme_restrict_mime_types( $mime_types ) { $mime_types = array( ‘wif’ => ‘text/plain’, ‘doc|docx’ => ‘application/msword’, ‘jpg|jpeg’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’ ); return $mime_types; } In this example I list all types that I allow (with WIF included). So you would need to add whats missing … Read more

How to protect uploads in multisite if user is not logged in?

Nice Question! Poking around it a little bit, this seems to be working (further tests and a more qualified look are much welcome:). Tested only in a localhost development install with subdomains. No domain mapping. Change the following .htaccess rewrite rule: # uploaded files # RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteRule ^files/(.+) dl-files.php?file=$1 [L] Make a … Read more

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