How to disable plupload completely from latest wordpress 3.6 and make browser upload default

This is how the plupload upoader is loaded on Media > Add New do_action( ‘pre-plupload-upload-ui’ ); // all the html output for plupload’s use do_action( ‘post-plupload-upload-ui’ ); If it was this instead: ob_start(); // all the html output for plupload’s use ob_end_clean(); Then no UI, no plupload: add_action( ‘pre-plupload-upload-ui’, ‘ob_start’ ); add_action( ‘post-plupload-upload-ui’, ‘ob_end_clean’ ); … Read more

Site running slow on new server?

Your site is very, very heavy at 4+ megs. Lighten it up; see http://gtmetrix.com/reports/www.moseleycoachsales.co.uk/eyz4qxQx Fix the code errors, such as not specifying image dimensions, not correctly scaling your images, not optimizing your images, setting browser caching and expires headers, etc. Your site speed has very little to do with one 404 for one style sheet. … Read more

Separate Uploads folder on other server

Assuming you want to have a CDN effect or even for some security reasons (we also look into that but CDN will cost us too much (we have over 1TB monthly)), maybe following links will guide you into the right direction. This info I found here on stackechange itself These links tell some about using … Read more

using wp_insert_attachment() results in guids with file names different to the same file when uploaded via media page in admin

So I figured this out. The function wp_insert_attachment() sanitizes file names parsed to it. In the process it was removing spaces in filenames. To avoid this I did my own sanitization (still using WP functions) before parsing the filenames. I renamed my files using sanitize_file_name() and this added hyphens (what I desired really) into all … Read more

Calling WP Gallery Uploader/Selector From Metabox

Figured out the answer to the question. file_frame.on(‘open’, function() { var selection = file_frame.state().get(‘selection’); var library = file_frame.state(‘gallery-edit’).get(‘library’); var ids = jQuery(‘#fg_perm_metadata’).val(); if (ids) { idsArray = ids.split(‘,’); idsArray.forEach(function(id) { attachment = wp.media.attachment(id); attachment.fetch(); selection.add( attachment ? [ attachment ] : [] ); }); file_frame.setState(‘gallery-edit’); idsArray.forEach(function(id) { attachment = wp.media.attachment(id); attachment.fetch(); library.add( attachment ? [ … Read more

Allow only attachment uploaded to current post

Maybe I was over thinking, but the solution is easier than I thought. I just have to limit the event handler to some element, so other unrelated ones will not trigger the handler. In this case, .media-modal is the overall parent of the media library element, so I am specifying this extra selector to the … Read more

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