Tagged: Contact form
Hi,
Thank you for using the plugin.1. I am sorry but I do not understand this question. If you do not want to show it in a tab, how do you want to show it?
2. Please give me some example to allow me check if it can be done or not?
Thank you
BrajeshHi,
Thank you.I am still a bit confused(showing it in profile header or the page showing user profile data). Is there way you can take a screenshot of the profile page and mark a location where this form should appear? That will help me greatly.
Thank you
BrajeshHi Brajesh
I’d like to add the contact us from here please: https://take.ms/uOVeR i.e. straight underneath the user’s profile data
Thanks!Hi Tom,
Thank you.It makes a lot more sense now. One of us will get back to you tomorrow with the feasibility.
Regards
BrajeshHi Tom,
I am sorry, we have missed it earlier. @ravisharma will post and update to the plugin and provide you with the code to achieve it on Monday.Thank you
BrajeshHello Tom,
Please try the following code and let me know if it works or not.
/** * Render contact form after profile loop */ function buddydev_after_profile_loop_render_contact_form() { if ( ! function_exists( 'bpucf' ) ) { return; } $is_visible = bpucf_is_form_visible( bp_displayed_user_id() ); if ( ! $is_visible ) { return; } echo '<h4>' . __( 'Contact Me' ) . '</h4>'; // Render contact form after profile loop. bpucf_load_form(); } add_action( 'bp_after_profile_loop_content', 'buddydev_after_profile_loop_render_contact_form' ); /** * Modify contact user form fields * * @param array $fields Form fields. * * @return mixed */ function buddydev_modify_form_fields( $fields ) { $fields['city'] = array( 'name' => 'city', 'type' => 'text', 'label' => __( 'City', 'buddypress-user-contact-form' ), 'required' => false, 'position' => 4, ); return $fields; } add_filter( 'bpucf_form_fields', 'buddydev_modify_form_fields' ); /** * Append your field data to the message * * @param string $message Message content. * * @return string */ function buddydev_modify_message_content( $message ) { if ( ! empty( $_POST['city'] ) ) { $city = sanitize_text_field( $_POST['city'] ); $message .= __( 'City: ' ) . $city; } return $message; } add_filter( 'bpucf_message_content', 'buddydev_modify_message_content' );
Regards
Ravi
You must be logged in to reply to this topic.