Created
August 7, 2014 14:57
-
-
Save corsonr/100f1b1976a43442c58d to your computer and use it in GitHub Desktop.
WooCommerce Product Enquiry: send email to post author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Product Enquiry Form: send email to post author instead of Site Admin | |
| add_filter( 'product_enquiry_send_to', 'wc_product_enquiry_to_author', 10, 2 ); | |
| function wc_product_enquiry_to_author( $email, $product_id ) { | |
| $post_author_id = get_post_field( 'post_author', $product_id ); | |
| $post_author_email = get_the_author_meta( 'user_email', $post_author_id ); | |
| return $post_author_email; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment