Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // paste this code inside your wp-content/themes/{themename}/functions.php
- add_action('wpcf7_posted_data', function( $posted_data ){
- // Subbmisson instance from CF7
- $submission = WPCF7_Submission::get_instance();
- // Make sure we have the data
- if ( ! $posted_data ) {
- $posted_data = $submission->get_posted_data();
- }
- // @note : change the name of your upload field.
- $file_upload_name = 'uploader-249';
- if( isset( $posted_data[ $file_upload_name ] ) ) {
- foreach( $posted_data[ $file_upload_name ] as $index => $file ) {
- if( wpcf7_is_url( $file ) ) {
- $posted_data["$file_upload_name"][$index] = base64_encode( file_get_contents( $file ) );
- }
- }
- }
- return $posted_data;
- },100, 1 );
Add Comment
Please, Sign In to add comment