Contact Form on author.php
-
I try to use Contact Form 7 on my author.php, to get a contact-form for every author.
I already tried propably all solutions out there and the special-mail-tag[_post_author_email]
doesn’t work on the author.php if you don’t wrap it in the loop and Contact Form 7 Dynamic Text Extension writes the recipient in the html-code.So I tried to modify the plug-in by editing the compose_mail function in classes.php.
I changed the line
$recipient = $this->replace_mail_tags( $mail_template['recipient'] );
to$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $_GET['author_name']) : get_userdata($_GET['author']); $recipient = $curauth->user_email;
and to
global $wp_query; $postquery = $wp_query->get_queried_object(); if ($postquery instanceof WP_User) { $the_email = $postquery->user_email; } else { $the_email = get_the_author_meta( 'user_email' ); } $recipient = $the_email;
But without luck. I’m not sure if you tolerate some alterations, but if you do so, I hope you could tell me what I’m missing.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Contact Form on author.php’ is closed to new replies.