Auto-Fill Data into Contact Form [3 Steps]
Just giving back to the community a bit, wish the classipress devs would step it up with basic features (report a post, share, THIS POST, etc.)
This is working with the version 3.1.8. Should work w/ future updates unless they actually incorporate it into the installation.
Step 1:
Open "classipress/includes/sidebar-contact.php"
Step 2:
Change Line 81 to:
Code:
<input name="from_name" id="from_name" type="text" minlength="2" value="<?php global $current_user; get_currentuserinfo(); echo $current_user->user_firstname; ?>" class="text required" />
Change Line 92 to:
Code:
<input name="from_email" id="from_email" type="text" minlength="5" value="<?php global $current_user; get_currentuserinfo(); echo $current_user->user_email; ?>" readonly="readonly" class="text required email" />
Step 3:
Save, enjoy.
*BONUS* Other Options:
You can modify what is displayed, edit the italicized "$current_user->
user_CHANGEME" with:
"user_login"
"user_firstname"
"user_lastname"
"display_name"
"ID" (registration number)
I also prefer to add the line "
readonly="readonly" " into the subject, so users cannot modify that. It would be:
Line 104
Code:
<input name="subject" id="subject" type="text" minlength="2" value="<?php _e('Re:', 'appthemes') ?> <?php the_title();?>" readonly="readonly" class="text required" />