Last active
December 3, 2017 12:16
-
-
Save rahularyan/7bd9c10783ce07d200f67c1042f52884 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/** | |
* Save a upload field. | |
*/ | |
function my_save_pdf_uploads( $post_id ) { | |
$field = $form->find('pdf'); | |
$field->save_uploads(); | |
foreach( $field->uploaded_files as $filename => $id ) { | |
update_post_meta( $post_id, 'my_custom_pdf', $id ); | |
} | |
} | |
add_action( 'ap_processed_new_question', 'my_save_pdf_uploads' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment