Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Problem getting Event ID with my custom Filter | Event Espresso - Staging Server

Support

Home Forums Custom Files Problem getting Event ID with my custom Filter

Problem getting Event ID with my custom Filter

Posted: October 10, 2013 at 8:24 am

Viewing 2 reply threads


Nick Power

October 10, 2013 at 8:24 am

Hi There, I took the advice from the thread:
http://staging.eventespresso.com/topic/custom-registration-id/. Very good idea and thanks Support but I’m not out of the woods just yet, I’ve found a problem.

I made my filter and when i use the add_filter code, I don’t seem to be getting the Event ID as an argument. It’s null. Just a thought, I noticed that If i keep both the stock AND my custom filter, then my code works fine.

<code>my_custom_registration_id($event_id){

  //Do something

}

// remove default registration id filter
function my_remove_registration_id_filter() {
	remove_filter(&#039;filter_hook_espresso_registration_id&#039;, &#039;espresso_build_registration_id&#039;, 10);
}
add_filter (&#039;filter_hook_espresso_registration_id&#039;, &#039;my_remove_registration_id_filter&#039;, 9 );

add_filter(&#039;filter_hook_espresso_registration_id&#039;, &#039;my_custom_registration_id&#039;, 10, 1);</code>

Any Ideas ?


Josh

October 10, 2013 at 9:13 pm

You can try removing the stock filter within your custom function (instead of another function) like this in order to keep the $event_id value:

//Build the registration id
function my_custom_registration_id($event_id){
  $something = 'something';
  remove_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id', 10, 1 );
  return $event_id . '-' . $something;
}
		
// add custom registration id filter
add_filter('filter_hook_espresso_registration_id', 'my_custom_registration_id', 9, 1);


Nick Power

October 11, 2013 at 2:10 am

Excellent! Thanks Josh! That worked perfectly.

Viewing 2 reply threads

The support post ‘Problem getting Event ID with my custom Filter’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server