Ready to get started?Download WordPress


Frontend Uploader
Allow URL field (2 posts)

  1. azparis
    Posted 2 years ago #

    Is there a way to add a URL field to the front end gallery upload? I'd like users to be able to submit a photo along with a blog entry that it links to.

    Any help is appreciated!

    Melanie LaDue



  2. Rinat Khaziev
    Plugin Author

    Posted 2 years ago #

    Hey Melanie,

    Sorry for the late reply, busy with my office work.

    This will require some additional coding.

    Shortcode part:
    [fu-upload-form class="your-class" title="Upload your media"]
    [textarea name="caption" class="textarea" id="ug_caption" description="Description (optional)"]
    [input type="file" name="photo" id="ug_photo" class="required" description="Your Photo" multiple=""]
    [input type="text" class="required" name="user_url" description="URL of your blog"]
    [input type="submit" class="btn" value="Submit"]

    PHP part to put in your theme's functions.php

    add_action( 'fu_after_upload', 'my_fu_after_upload' );
    function my_fu_after_upload( $attachment_ids ) {
    	foreach( (array) $attachment_ids as $att_id ) {
    		if ( isset($_POST['user_url'] ) ) {
    			update_post_meta( $att_id, 'user_url', esc_url( $_POST['user_url'] ) );

    Note that this is not tested. What it'll do is to add meta field for each uploaded file with an url.

    I'm currently working on the new version, that'll allow handling of fields automatically. So if PHP stuff is over your head, I suggest you to wait until the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic