Title: Need help with child theme functions code
Last modified: November 30, 2021

---

# Need help with child theme functions code

 *  Resolved [tracyemma](https://wordpress.org/support/users/tracyemma/)
 * (@tracyemma)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-child-theme-functions-code/)
 * I need to implement both of the following functions. If added individually, each
   works, but together, they do not. How can this be rewritten so that they will
   function together? Thanks
 *     ```
       // Adds additional rsvp notifications
       function your_function_mail_bcc( $headers = array(), $event_id = null, $order_id = null ) {
           $headers[] = 'bcc: info@website.com';
        	return $headers;
        }
        add_filter( 'tribe_rsvp_email_headers', 'your_function_mail_bcc' );
   
       // Add a custom "from" name and email to the rsvps
        add_filter( 'tribe_rsvp_email_headers', function() {
         $name  = 'Website Name';
         $email = 'no-reply@website.org';
   
         return 'Content-type: text/html' . "\r\n" . "From: $name <$email>" . "\r\n";
        } );
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Juanfra Aldasoro](https://wordpress.org/support/users/juanfra/)
 * (@juanfra)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-child-theme-functions-code/#post-15121284)
 * Hi [@tracyemma](https://wordpress.org/support/users/tracyemma/),
 * Thank you for reaching out. You’re using the same filter to hook twice and then
   returning two different types of data. On the first one, you return an array.
   On the second, you’re returning a string. You could possibly adapt things to 
   use just one function.
 *     ```
       // Adds additional rsvp notifications.
       function your_function_mail_headers( $headers = array(), $event_id = null, $order_id = null ) {
           $name  = 'Website Name';
           $email = 'no-reply@website.org';
   
           $headers[] = 'Content-type: text/html';
           $headers[] = 'bcc: info@website.com';
           $headers[] = "From: $name <$email>";
   
           return $headers;
        }
        add_filter( 'tribe_rsvp_email_headers', 'your_function_mail_headers', 10, 3 );
       ```
   
 * Best,
    Juan.
    -  This reply was modified 4 years, 6 months ago by [Juanfra Aldasoro](https://wordpress.org/support/users/juanfra/).
    -  This reply was modified 4 years, 6 months ago by [Juanfra Aldasoro](https://wordpress.org/support/users/juanfra/).
 *  Thread Starter [tracyemma](https://wordpress.org/support/users/tracyemma/)
 * (@tracyemma)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-child-theme-functions-code/#post-15121965)
 * Hi [@juanfra](https://wordpress.org/support/users/juanfra/)
 * That worked. Thank you for the help and the explanation; I really appreciate 
   it.
 *  [Juanfra Aldasoro](https://wordpress.org/support/users/juanfra/)
 * (@juanfra)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-child-theme-functions-code/#post-15121984)
 * Hi [@tracyemma](https://wordpress.org/support/users/tracyemma/),
 * Thanks for the follow-up.
 * I’m glad to be of help 🙂 Grateful that you like the plugin and support.
 * Have a fantastic day,
    Juan.
    -  This reply was modified 4 years, 6 months ago by [Juanfra Aldasoro](https://wordpress.org/support/users/juanfra/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Need help with child theme functions code’ is closed to new replies.

 * ![](https://ps.w.org/event-tickets/assets/icon.svg?rev=2259340)
 * [Event Tickets and Registration](https://wordpress.org/plugins/event-tickets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-tickets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-tickets/)
 * [Active Topics](https://wordpress.org/support/plugin/event-tickets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-tickets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-tickets/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [Juanfra Aldasoro](https://wordpress.org/support/users/juanfra/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-child-theme-functions-code/#post-15121984)
 * Status: resolved