WordPress.org

Forums

Frontend Uploader
[resolved] Is there a way to add email and name fields to the Frontend Uploader form? (8 posts)

  1. socialpyramid
    Member
    Posted 3 years ago #

    Hi. I added this Frontend Uploader plugin but I can't figure out how to add fields like a required email address. Is there a way to do that?
    Thanks

    http://wordpress.org/extend/plugins/frontend-uploader/

  2. Rinat Khaziev
    Member
    Plugin Author

    Posted 3 years ago #

    Hey,

    Check the other notes in plugin's readme, it's fairly easy if you know how to use filters. The shortcode part would be

    [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"]
    [input type="text" name="email" id="ug_email" class="required" description="Your email"]
    [input type="text" name="name" id="ug_name" class="required" description="Your name"]
    [input type="submit" class="btn" value="Submit"] [/fu-upload-form]

    Then you'll need to add your custom filter to a hook "fu_after_upload" to save your additional information.

    http://wordpress.org/extend/plugins/frontend-uploader/other_notes/

    Let me know if this makes any sense to you

  3. socialpyramid
    Member
    Posted 3 years ago #

    Hi Rinat. Thanks for the detailed response! I really appreciate that.

    The shortcode additions make a lot of sense, thanks for sharing that. I'm a newbie though and I don't quite know how to implement the last part, namely "Then you'll need to add your custom filter to a hook "fu_after_upload" to save your additional information."

    I see in that link it says this: add_action( 'fu_after_upload', function( $attachment_ids ) { // do something with freshly uploaded files // This happens on POST request, so $_POST will also be available for you } );

    I'm not sure how to modify that string in this case for those fields, but I suspect I have to tell it to address those fields in particular. Also, does this after upload code go on the same page as the other shortcode?

    Thanks!

  4. Rinat Khaziev
    Member
    Plugin Author

    Posted 3 years ago #

    Do you have any experience with PHP/ and theme development for WordPress?

    You should place this code in your theme's functions.php. E.g (not tested):

    add_action( 'fu_after_upload', 'my_fu_after_upload' );
    
    function my_fu_after_upload( $attachment_ids ) {
        foreach( $attachment_ids as $aid ) {
            // do something with your additional data
        }
    }
  5. socialpyramid
    Member
    Posted 3 years ago #

    I have never used PHP and I'm not a programmer although I am pretty good with WordPress and computers in general. Thanks again!

    I'll give this a try and investigate further when I get back in town from a trip.
    Best

  6. mmmmagnus
    Member
    Posted 3 years ago #

  7. Rinat Khaziev
    Member
    Plugin Author

    Posted 3 years ago #

    mmmmagnus, I replied to your thread.

  8. D5Wdan
    Member
    Posted 2 years ago #

    Hello Rinat,
    I have installed the plugin and everything seems to work well except when I got to Media/Manage UGC/File, the only information that shows up from the form is Title,Description and the uploaded photo. I havent been able to see the Author,Email Address, Credit etc. I am fairly new to WordPress and have read through the plugin's ReadMe file. Any tips?

    Thank You

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Frontend Uploader
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic