Incorrect Theme and Upload URLs After Migration

Something went seriously wrong here. Is there a chance you can repeat the process on behalf of your client? Try to use Duplicator plugin it really helps with migrations. Or do a manual mysql dump on old hosting and import the database yourself. This definitely went wrong during the database migration.

WordPress file upload

WordPress has it’s own way of handling file uploads, so it’s best to follow their lead on that. It does do some file validation, but if you want to be restrictive with MIME types I’d keep the code you originally have, Here’s the code that can replace your second block though to actually upload the … Read more

Creating an Uploads folder with post ID

I wrote this code for you: global $lesson_id; $lesson_id = $_POST[‘lesson_id’]; function create_uploads_folder() { global $lesson_id; $upload_dir = wp_upload_dir(); $upload_dir = $upload_dir[‘basedir’]; $upload_dir = $upload_dir . ‘/submissions/’. $lesson_id; if ( ! is_dir( $upload_dir ) ) { wp_mkdir_p( $upload_dir ); } } register_activation_hook( __FILE__, ‘create_uploads_folder’ ); // Upload file $uploadFolder = wp_upload_dir(); if ( ! move_uploaded_file($_FILES[‘file_upload’][‘tmp_name’], … Read more