Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active August 16, 2016 20:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/ff95466508bc31d88bad2d882fd0780e to your computer and use it in GitHub Desktop.
Save Shelob9/ff95466508bc31d88bad2d882fd0780e to your computer and use it in GitHub Desktop.
add_filter( 'cf_pdf_pdf_name', function( $name, $form_id ){
//Set your form's ID here
if( 'cf12346' == $form_id ){
$name = 'WPCrowd FTW';
}
return $name;
}, 10, 2 );
add_filter( 'cf_pdf_pdf_name', function( $name, $form_id, $form, $entry_id ){
//Set your form's ID here
if( 'cf12346' == $form_id ){
//change first param to ID of your field
$value = Caldera_Forms::get_field_data( 'fl12345', $form, $entry_id );
if ( is_string( $value ) && ! empty( $value ) ) {
$name = $value;
}
}
return $name;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment