Title: Consent message
Last modified: January 30, 2019

---

# Consent message

 *  Resolved [PaulMah](https://wordpress.org/support/users/paulmah/)
 * (@paulmah)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/)
 * Hi there,
 * There is a tick box option for Privacy at Events > Settings > Privacy. The error
   message when this is not ticked is: “You must allow us to collect and store your
   data in order for us to process your booking.”
 * How/where can I edit this please?
 * Thank you…Paul

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

 *  [Stonehenge Creations](https://wordpress.org/support/users/duisterdenhaag/)
 * (@duisterdenhaag)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/#post-11158628)
 * Hi Paul,
 * You could try this:
 *     ```
       function change_privacy_error( $alternate_text, $text, $domain ) {
               switch ( $alternate_text ) {
                   case 'You must allow us to collect and store your data in order for us to process your booking.' :
                       $alternate_text = 'This is the new text.';
                       break;
               }
           return $alternate_text;
       }
       add_filter( 'gettext', 'change_privacy_error', 20, 3 );
       ```
   
 *  [Stonehenge Creations](https://wordpress.org/support/users/duisterdenhaag/)
 * (@duisterdenhaag)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/#post-11158639)
 * Or even this one:
 *     ```
       <?php 
       /**
        * Change the message "You must allow us to collect and store your data in order for us to process your booking."
        * Validates a bookng to ensure consent is/was given.
        * @param bool $result
        * @param EM_Booking $EM_Booking
        * @return bool
        */
       function em_snippet_data_privacy_consent_booking_validate( $result, $EM_Booking ){
   
       	if( is_user_logged_in() ){
       		//check if consent was previously given and ignore if settings dictate so
       		$consent_given_already = get_user_meta( get_current_user_id(), 'em_data_privacy_consent', true );
       		if( !empty( $consent_given_already ) && get_option( 'dbem_data_privacy_consent_remember') == 1 ) return $result; //ignore if consent given as per settings
       	}
           if( empty( $EM_Booking->booking_meta['consent'] ) ){
       	    $EM_Booking->add_error( sprintf( __( 'PUT_YOUR_CUSTOM_MESSAGE_HERE', 'events-manager' ) ) );
       	    $result = false;
           }
           return $result;
       }
   
       function em_snippet_data_privacy_consent_hooks(){
       	//BOOKINGS
       	if( get_option( 'dbem_data_privacy_consent_bookings' ) == 1 || ( get_option( 'dbem_data_privacy_consent_bookings' ) == 2 && !is_user_logged_in() ) ){
       		remove_filter( 'em_booking_validate', 'em_data_privacy_consent_booking_validate', 10, 2 );
       		add_filter( 'em_booking_validate', 'em_snippet_data_privacy_consent_booking_validate', 10, 2 );
       	}
       }
   
       add_action( 'init', 'em_snippet_data_privacy_consent_hooks' );
   
       ?>
       ```
   
 *  Thread Starter [PaulMah](https://wordpress.org/support/users/paulmah/)
 * (@paulmah)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/#post-11162974)
 * Brilliant thank you Patrick. Where would I add this new code please? Thank you…
   Paul
 *  [Stonehenge Creations](https://wordpress.org/support/users/duisterdenhaag/)
 * (@duisterdenhaag)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/#post-11162983)
 * If you are using your own theme, you can simply add it to your functions.php.
   But if not, all changes will be lost if the theme is updated.
 * You could also use this plugin to add custom coding to your WP installation:
   
   [https://nl.wordpress.org/plugins/code-snippets/](https://nl.wordpress.org/plugins/code-snippets/)
 *  Thread Starter [PaulMah](https://wordpress.org/support/users/paulmah/)
 * (@paulmah)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/#post-11165212)
 * Thank you Patrick, will get the code snippet plugin.

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

The topic ‘Consent message’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [PaulMah](https://wordpress.org/support/users/paulmah/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/consent-message/#post-11165212)
 * Status: resolved