• Resolved zagrox

    (@zagrox)


    I need to change and rename the default upload folder in job manager for more security and protection
    Found this code, but its only change the location and the folder name “job-manager-upload” remains the same.

    add_filter( 'job_manager_upload_dir', 'my_custom_job_manager_upload_dir' );
    
    function my_custom_job_manager_upload_dir( $job_manager_uploading_file ) {
    
    	// This is the default below
    	// $dir = 'job-manager-uploads/' . $job_manager_uploading_file;
    	
    	// This is using a custom directory, make sure to add $job_manager_uploading_file to the end of the string
    	$dir = 'custom_jm_uploads/' . $job_manager_uploading_file;
    	
    	return $dir;
    }

    can anyone provide custom function code to rename this folder, or any other solution?

    • This topic was modified 5 years, 6 months ago by zagrox. Reason: code was not accure
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi!

    I tried the snippet and it worked for me. It uploaded my attachment in the custom_jm_uploads folder. You can rename that folder to be whatever you want. Does you want it to be retroactive? If so, it’ll be a bit of work. Besides renaming the actual folder, you would need to do a find-replace across his WordPress database.

    If what you’re looking to do is change the job-manager-upload folder name, well. for what purpose? Using the snippet will change where attachments are uploaded, so even if the original job-manager-upload folder remains, it doesn’t matter, nothing will be found there.

    Plugin Contributor Richard Archambault

    (@richardmtl)

    I’m marking this thread as Resolved as it’s been more than a month since the last reply. If you still need help, please do reply again and mark the thread as Unresolved!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change & rename upload folder name’ is closed to new replies.