Title: add_filter hack is not working&#8230;
Last modified: August 24, 2016

---

# add_filter hack is not working…

 *  [a42](https://wordpress.org/support/users/a42/)
 * (@a42)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add_filter-hack-is-not-working/)
 * Hi there
 * I’m trying to hack a plugin by insert a dynamic variable into a wp_mail()…
 * The plugin initialize a send_to – variable with:
 * $this->send_to = get_option( ‘woocommerce_product_enquiry_send_to’ );
 * this is being used as follow:
 * if ( wp_mail( apply_filters( ‘product_enquiry_send_to’, $this->send_to, $product_id),
   $subject, $message, $headers ) )
    echo ‘SUCCESS’; else echo ‘Error’;
 * I have created a function:
 * function enquiry_to_vendor($email , $product_id ) {
    global $product;
 *  $vendors = get_product_vendors( $product->id );
    if( $vendors ) { foreach( $
   vendors as $vendor ) { $email = $vendor->paypal_email; }
 *  return $email;
    }
 * }
 * and applying add_filter:
 * add_filter( ‘product_enquiry_send_to’, ‘enquiry_to_vendor’, 11, 2 );
 * But I get nothing in the send_to field in the wp_mail() when do that add_filter–
   I have also tried to remove_filter() but with out luck…
 * Has this to be done in another way since WP ver. 4.1.1 or am I missing something?
 * Cheers,
    Adam

The topic ‘add_filter hack is not working…’ is closed to new replies.

## Tags

 * [add_filter](https://wordpress.org/support/topic-tag/add_filter/)
 * [remove_filter](https://wordpress.org/support/topic-tag/remove_filter/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [a42](https://wordpress.org/support/users/a42/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/add_filter-hack-is-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
