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
if statement to check if the user has registered for any classes? | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium if statement to check if the user has registered for any classes?

if statement to check if the user has registered for any classes?

Posted: July 31, 2012 at 9:26 am

Viewing 2 reply threads


Kevin Doherty

July 31, 2012 at 9:26 am

I have a link wich directs a user when logged in to “my events”. I’d like to further refine the visibility of that link to only show if the user is not only logged in but has in fact ever registered to a class or has a class in listed in their “my events’ section in the admin.

Any help is greatly appreciated.
thanks!


Josh

August 1, 2012 at 9:45 am

<?php 
$sql = "SELECT id FROM ". EVENTS_MEMBER_REL_TABLE . " WHERE user_id = %d";
  if ( $mbr_id = $wpdb->get_var( $wpdb->prepare( $sql, $current_user->ID ))) {
    echo "you have registered for an event";
} else {
     echo "you didn't register for anything yet";
}
?>


Kevin Doherty

August 1, 2012 at 12:00 pm

Awesome, thanks Josh!

Viewing 2 reply threads

The support post ‘if statement to check if the user has registered for any classes?’ 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