• Resolved xanuex

    (@xanuex)


    I’ve used the code below to select a different folder then the default Media Library for saving my uploaded files from the contactform7 form I’ve made.

    function define_cf7_upload_dir( $fullFileName ){
        $fileName = basename($fullFileName);
        
        //replace $myDir with your own folder
        $myDir = "./wp-content/uploads/wpcf7_uploads/";
    	
        $fullURL = $myDir . $fileName;
        return $fullURL;
    }
    add_filter('nmr_create_attachment_file_name', 'define_cf7_upload_dir');

    This works well, the only problem I have is that somewhere it still files it as an empty icon in the Media Library and creates all the thumbnail versions as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author mirceatm

    (@mirceatm)

    Hi, in the new version 1.2.3 there is a filter called nmr_should_skip_save_attachment_to_media_library

    Return true to skip saving to Media Library like below:

    add_filter( 'nmr_should_skip_save_attachment_to_media_library', 
    function ($skip_save_to_media_library){
    return true;
    }, 10, 1 );
    Thread Starter xanuex

    (@xanuex)

    Thanks, worked like a charm!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.