Missing data for $_POST in fu_after_upload action
-
I’m trying to use added fields in Frontend uploader, and for the moment I can only find trace of one. When I enter the my_fu_after_upload function the $_POST variable only contains data for destination field, not the other fields.
Here’s what I put in the template:
$sc = '[fu-upload-form class="your-class" title="1) Upload your Travel photographs"]'; $sc .= '[input type="file" name="photo" id="ug_photo" class="required" description="" multiple="true"]'; $sc .= '[input type="file" name="headerPhoto" id="headerPhoto" class="required" description="<h2 class=destination>2)Upload header photo</h2>" ]'; $sc .= '[input type="text" name="destination" id="destination" class="required" description="<h2 class=destination>3) Type your Destination here:</h2>" ]'; $sc .= '[input type="submit" class="btn" id="submission" value="Let MyTravelLog build Your Blog!"]'; $sc .= '[/fu-upload-form]'; echo do_shortcode($sc);
In my functions.php I have the following:
add_action( 'fu_after_upload', 'my_fu_after_upload', 10, 10 ); function my_fu_after_upload( $attachment_ids, $success, $post_id ) { update_post_meta( $post_id, 'destination', $_POST['destination'] ); update_post_meta( $post_id, 'tripTo', $_POST['tripTo'] ); }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Missing data for $_POST in fu_after_upload action’ is closed to new replies.