Skip to content

Commit 488a530

Browse files
committed
add attachment url to form submission page w/ attachment id
1 parent 2d90a51 commit 488a530

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

inc/wplf-ajax.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function wplf_ajax_submit_handler() {
5959
// Is this enough security wise?
6060
// Currenly only supports 1 file per input
6161
$attach_id = media_handle_upload( $key, 0, array(), array( "test_form" => false ) );
62-
add_post_meta($post_id, $key, $attach_id);
62+
add_post_meta( $post_id, $key, wp_get_attachment_url($attach_id) );
63+
add_post_meta( $post_id, $key . "_attachment", $attach_id );
6364
}
6465

6566

0 commit comments

Comments
 (0)