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

    (@arshidkv12)

    It needs custom add-on. Please connect me [email protected]

    This helps me:

    add_filter( ‘cfdb7_before_save_data’, function ( $form_data ) {

    $upload_dir = wp_upload_dir();
    $cfdb7_dirname = $upload_dir[‘basedir’] . ‘/cfdb7_uploads’;
    foreach ( $form_data as $key => $val ) {
    if ( str_contains( $key, ‘cfdb7_file’ ) ) {
    $file = $cfdb7_dirname . ‘/’ . $val;
    unset( $form_data[ $key ] );
    unlink( $file );
    }
    }

    return $form_data;
    } );

    • This reply was modified 6 months, 1 week ago by Jakub.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Prevent saving attachments?’ is closed to new replies.