Last active
August 16, 2016 20:51
-
-
Save Shelob9/ff95466508bc31d88bad2d882fd0780e to your computer and use it in GitHub Desktop.
Filters for use with Caldera Forms PDF * https://calderawp.com/doc/caldera-forms-pdf-getting-started/ * https://Caldera.space *
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'cf_pdf_link_message', function( $message ){ | |
return 'Download Registration Details'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment