caldera_forms_upload_directory

Caldera Forms Banner

This filter was added in Caldera Forms 1.4.5

You can change the directory, relative to WordPress’ upload directory for Caldera Forms file and advanced file fields to upload to using the caldera_forms_upload_directory filter. This filter is one way to use an alternative upload directory for Caldera Forms.

This filter does not affect files that are not being uploaded to the media library. In addition, this filter can not be used to upload files outside of the uploads directory. If you want to upload to an alternative directory or to a different storage system — Dropbox, Google Drive, Amazon s3, etc — you should use a custom file upload handler.

This filter only works if the field is set to upload to the media library. If you are not using the media library, you likely want to use the caldera_forms_private_upload_directory filter instead.

Upload All Caldera Forms Files To A Different Directory

Set A Different Upload Directory For One File Field

Upload Files To A Directory Named For That File

 

Where Does This Code Go?

When using WordPress hooks to customize Caldera Forms or other plugins you should not modify the plugin files, or you will lose your changes when you update the plugin. Instead you should create a small plugin to hold the custom code. It's easy, learn how here.

Technically you can add the custom code to your theme's functions.php, but then you will not be able to change your theme and keep these customizations.

Learn More