buddypress function in themes functions.php
-
Hi guys!
Just a short question.
I’ve created a custom funtion in my themes functions.php (not in buddypress-functions.php!).
The interesting part looks like this:function mycf7_before_send_mail($WPCF7_ContactForm) { $new_recipient = bp_get_profile_field_data('field=Email for contact&user_id='.bp_displayed_user_id()); $mail = $WPCF7_ContactForm->prop('mail'); $mail['recipient'] = $new_recipient; $WPCF7_ContactForm->set_properties( array( 'mail' => $mail ) ); } add_action( "wpcf7_before_send_mail", "mycf7_before_send_mail" );
So I’m trying to call a buddypress function to get the email of the currently visited user. But the buddypress function is not working in functions.php. Any suggestions how to solve it? I can’t call it in buddypress-functions.php. It needs to be in the themes functions.php.
Regards
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘buddypress function in themes functions.php’ is closed to new replies.