DotDragnet
May 24, 2012, 08:52:38 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: adding fields to the comments in WordPress  (Read 155 times)
SLEE
Hero Member
*****
Posts: 824



View Profile WWW Awards
« on: December 06, 2011, 07:04:14 PM »

I want to be able to add more fields to the comment form including a date field and a multiple image upload field.

I have found a few links showing how it might be possible to add more text fields but how would i allow uploading of multiple photos?

When using this contact form the user will be logged in. Ideally I would like to upload the image and have it resized as using WordPress uploader but is this possible as it is on the front end?

i do use Gravity Forms but as far as I am aware currently it is not possible to use this with comments?

any help will be greatly appreciated
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
sarahA
DDN Contribs
Hero Member
*****
Posts: 2184



View Profile WWW Awards
« Reply #1 on: December 06, 2011, 09:32:42 PM »

To add the fields use the filter 'comment_form_after_fields'

For authentication/validation of the entries use the action 'pre_comment_on_post'

To save the date and associate the images uploaded with the comment use the action comment_post which will give you the comment ID. If the user is logged in then you can also get their ID via $user_ID (probably need to make it global).

You should possibly be able to load the WP uploader into the frontend, I see no reason why not, you're just calling the right function to do so. You can at least call the WP functions to validate and resize the image. You'll need to look through the source code to find the right function names to use though.

This might help with getting the media uploader working - http://lewayotte.com/2010/09/27/using-wordpress-built-in-media-upload/
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!