How to get WordPress to save upload file beyond web root [closed]
How to get WordPress to save upload file beyond web root [closed]
How to get WordPress to save upload file beyond web root [closed]
I’ve ruled out this being an issue with Advanced Custom Fields, so I’ve made a new question. For more information, please look at: wp_get_attachment_image_src multisite issue
WordPress REST Upload Media
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
The fileurl should look like this: fileurl = $(‘a’, html).attr(‘href’); It’s a pretty simple fix. I would do some validation on this: if(/\.mp3\b/.test(fileurl)){ //Do something awesome }else{ alert(‘The file you selected is not an MP3.’); } Cheers!
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
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
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
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
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