Missing a temporary folder not fixed

You need to add that line to your wp-config.php. Double check that you put it in the right place. You need to set the permissions on that directory you created so that WordPress can write to it. This is dependent on how your hosting works and what program you’re using, but you should try setting … Read more

Unset image sizes before images are uploaded

You get $sizes as array, where size name is a value, not a key Try this //remove sizes with init hook and remove_image_size add_action(‘init’, function ($sizes) { remove_image_size(‘2048×2048’); remove_image_size(‘1536×1536’); return $sizes; }); // or just return sizes you need add_filter(‘intermediate_image_sizes’, function ($sizes) { return [‘thumbnail’,’medium’,’large’]; });

Remove files unrelated to WordPress from uploads

I don’t know whether there is a better WP-CLI way or not, but you could write a simple script that recursively crawls your uploads directory (or it’s subdirectories) and than check the absolute paths (URLs) of those files and compare them against guid column in wp_posts table. If your file is not there, WordPress doesn’t … Read more

media file uploading

jQuery(document).ready(function($){ $(‘#txt_image’).click (function(e){ e.preventDefault(); var image = wp.media({ title:”Upload Image”, multiple:false }).open().on(“select”, function(e){ var uploaded_image = image.state().get(“selection”).first(); var image_data = uploaded_image.toJSON(); jQuery(“#getImage”).attr(“src”, image_data.url); jQuery(“#student_image”).val(image_data.url); }); }); });