WordPress User Integration

Create members-only events while keeping other events open to the public. Accounts for your attendees will be automatically created after they register, so they have access to past and upcoming events. Then the next time an attendee registers, they can log in, and their registration details will be pre-populated so they can check out quickly.

View quick links for this integration –> 

Need documentation for Event Espresso 3? You can click here.


Need to buy a support license for the EE4 WP User integration?
Purchase a support license for the WP User integration for Event Espresso


Installation for the Event Espresso 4 WP User Integration

ee4-wp-user-integrationThis add-on is a plugin for WordPress and can be installed through your WP dashboard (WP-admin).

Download the latest version of the WP User integration for Event Espresso 4 from your Event Espresso account.

Then login to your  WordPress dashboard (WP-admin) and go to Plugins. Next, click on Add New –> Upload and browse to the plugin on your computer. Then select the zip file and begin the upload process. Wait for the plugin to upload and then click on Activate.

Setup and Configuration for the EE4 WP User Integration

Log in to your  WordPress dashboard. Then go to Settings –> General. On the next screen, look for the Membership option and place a checkmark next to Anyone can register. Then save changes.

Next, go to  Event Espresso –> Registration Form –> User Integration Settings. This page shows settings that affect the member functionality of this add-on.

Below are the available fields and explanations for each field.

  1. Default setting for Login Required on Registration – if set to Yes, then your attendees/registrants will only be able to register for an event if they are logged in to your site
  2. Default setting for User Creation on Registration – Specify if a new user should be created during registration checkout
  3. Default role for User Creation on Registration – Specify the WordPress user role that should be used when a new user is created
  4. Always sync contact information with WP user profile? – Specify whether changes to registration form answers on returning registrations will update the contact details and WordPress user profile information

Make changes as needed and then click on Save Settings. Note that these changes are optional and the first 3 can also be managed on a per-event basis via the event editor for Event Espresso:

wp-user-integration-event-settings

Now you’ll need to give attendees/registrants a way navigate to the registration/log-in page. The default WordPress page for logging in is the same URL you use to log into your WordPress site: example.com/wp-login.php. The registration page URL is example.com/wp-login.php?action=register. You can post these links anywhere on your site. Some members use the built-in meta widget in widgetized areas of the theme. There are also plugins that allow for a little more control over what happens after logging in, and one example is the Simple login plugin.

You may want to “brand” the log-in page for your WordPress site. A nice and simple plugin that lets you do this is the Login Logo plugin developed by Mark Jaquith.

Usage for the Event Espresso 4 WP User Integration

The add-on will allow you to specify tickets that are available to members and non-members. To do this, go to  Event Espresso –> Events. Then click on an existing event or click on Add New if you are creating your first event in Event Espresso. You’ll now be viewing the event editor. Add an event name along with a description and scroll down. You should see the ticket (pricing) editor. Create your ticket options and then click on the gear (advanced options icon). Towards the end of the ticket, you’ll see a setting for Ticket Capability Requirement.

The Ticket Capability Requirement allows you to set the user capability required to purchase a ticket and uses the Roles and Capabilities feature of WordPress. To offer a simple members-only ticket, enter “read” in the field. You can use this field across multiple tickets to provide tickets for different types of members. Be sure to save changes to your event.

ticket-capability-requirement-setting

How do I use it?
Creating these type of restrictions utilizes the Roles and Capabilities feature of WordPress. In this field, you indicate the capability that a visitor must have as a part of their user profile when logged in and viewing the ticket options. For example, if you have the s2Member® plugin installed, and you input the “access_s2member_level1” into this field, then the visitor must be logged in and have the “s2member_level1” (or greater) role assigned to their user.
s2Member® Support
s2Member® is a great tool that can be used to extend the EE4 WP User Integration add-on, because of the additional features it makes available for websites that depend upon membership fees. s2Member® makes it easy to secure WordPress content and offer users/members a secure checkout solution that integrates seamlessly with WordPress Roles/Capabilities.


s2Member® is a third-party WordPress plugin. It is not required, nor affiliated with Event Espresso.

Supported s2Member® Roles
If you have s2Member® installed on your site, you can use any of the following capabilities to limit access to tickets based on a certain s2Member® role:

  • access_s2member_level0
  • access_s2member_level1
  • access_s2member_level2
  • access_s2member_level3
  • access_s2member_level4

You can learn more about Roles & Access Capabilities from the s2Member Roles & Capabilities documentation.

Contacts & User Admin Screen

The EE4 WP User Integration allows event administrators to view linked contacts and WP users quickly.

Show what WP user an Event Espresso 4 contact record is linked to when viewing an EE4 contact.

view-linked-wp-member-contact-1

Show what contact is linked to the user profile when viewing the /users.php page in the backend

linked-ee-contact

How to link a contact to an existing WordPress User Account

If some Event Espresso contacts are not connected to existing WordPress user accounts you can link them by following the guide published here:
https://gist.github.com/joshfeck/2165ff295c968f861cef8775fc8b1dc9

Your Registrations Page Shortcode

This shortcode allows you to create a front facing page for members to view their registration history. By logging into your site, and viewing a specific WordPress page on the front-end of your website, users can see events they’ve registered for in the past.

Just add the [ESPRESSO_MY_EVENTS] shortcode to any page, and your users will see a nice looking table of past registrations.

my-events-expanded-2

The table rows are expandable and offer more details about each registration.

Available shortcode parameters

  • template : defaults to event_section. Can be either simple_list_table or event_section as the template slug (see screenshots above for difference. This has been designed so developers can hook in their own templates down the road if they want (or we can add additional layouts at whim as well).
  • per_page : defaults to 10. This allows the user to set the limit of rows that are shown before pagination kicks in on the main table (the event_section template does no pagination of tickets listed for each event).
  • your_events_title : defaults to localized “Your Events”. This allows for users to customize the label for the listing.
  • your_tickets_title : defaults to localized “Your Tickets”. This allows for users to customize the label for the listing of your tickets. Note, the “Your Tickets” label is currently only used with the event_section template.

Behavior with logged in vs logged out.

  • When a logged out user visits a singular view of a post/page/custom_post_type that has the shortcode in it, then they will be automatically redirected to the WordPress login form. When they log in, they will be redirected back to that page.
  • When a logged out user visits an archive view of post/custom_post_type, any content that has this shortcode in it will display a link to the wp-login form as the parsed shortcode content. Clicking that link will take the user to the login form and once they log in they will be redirected back to the page they came to the login form from.

Other notes

  • We intentionally did not do a lot of styling on the tables leaving the majority of it up to themes.
  • Regarding responsiveness, if a theme is set up to have responsive tables then the layouts for these tables will work fairly well. Again, we intentionally was very minimal in terms of CSS applied so that the tables will inherit from themes.
  • Developers can override the templates by copying the files from the template directory into your theme.

User Profile Admin Page: My Events Page

Logged in users can view events they’ve registered for in the past, just by logging into your website and viewing their profile from within the WordPress admin.

all-your-registrations

Troubleshooting the Event Espresso 4 WP User Integration

The plugin does not work as expected. Can you help?
Please ensure that you are running a current version of Event Espresso 4. This add-on requires Event Espresso 4.6 and is not compatible with older versions of Event Espresso.

What information is pre-populated?
At this time, the first name, last name, and email address are pre-populated. An enhancement is coming to a future version that will pre-populate additional fields (e.g., address fields).

I use S2 Member, and the login form on the registration page is broken. What gives?

This is caused by S2 Member hooking into wp_login and adding a redirect there. You can remove the S2 Redirect by adding the filter function shown in this gist to your functions plugin:

<?php
add_filter("ws_plugin__s2member_login_redirect", "my_custom_login_redirect", 10, 2);
function my_custom_login_redirect($redirect, $vars = array())
    {
        // If you do NOT want s2Member to perform the redirect, return false.
        return false;
    }
?>

Visit the row on Git: https://gist.github.com/joshfeck/b8293f62329e34d4cde0#file-s2_member_login_redirect-php

Customizations for the Event Espresso 4 WP User Integration

Our support team cannot write custom coding for you. Below are some examples on customizing this integration.

Customize the restricted message and include a link to log in

<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file

add_filter( 
  'FHEE__EED_WP_Users_Ticket_Selector__maybe_restrict_ticket_option_by_cap__no_access_msg',
  'my_custom_no_access_message',
  10,
  4
);

function my_custom_no_access_message( $content, $tkt, $ticket_price, $tkt_status ) {
  $url = wp_login_url( get_permalink() );
  $content = $tkt->name() . ' becomes available if you log in to your account. ';
  $content .= 'You can <a href="'. $url .'" title="Log in">log in here</a>.';
  return $content;
}

Visit the row on Git: https://gist.github.com/joshfeck/1a574f951fea3941ef8bcd3681abbb5c#file-wp_user_restrict_ticket_option_message-php

Completely hide restricted ticket message

<?php
// Do not include the opening php tag if you already have one.

//This function returns and emptry string for tickets that your user account does not have capabilities to view.
function tw_ee_hide_tickets_with_caps() {

	return '';

}
add_filter('FHEE__EED_WP_Users_Ticket_Selector__maybe_restrict_ticket_option_by_cap__no_access_msg_html', 'tw_ee_hide_tickets_with_caps' );

Visit the row on Git: https://gist.github.com/Pebblo/106393acd850cb83c3798c66a9c5a19a#file-functions-php

Display a message and remove the ticket selector if the user has already registered onto the event before

<?php //Please do not include the opening PHP tag if you already have one.

add_action( 
  'AHEE_event_details_before_the_content',
  'my_add_content_event_if_logged_in_registered', 
  11
);

function my_add_content_event_if_logged_in_registered( $post ) {
    if ( is_user_logged_in() ) {
        $user = wp_get_current_user();
        if ( ! $user instanceof WP_User ) {
            return;
        }
        //is there an attached EE_Attendee?
        $att_id = get_user_option( 'EE_Attendee_ID', $user->ID );
        if ( empty( $att_id ) ) {
            return; //bail, no attached attendee_id.
        }
        //grab contact
        $contact = EEM_Attendee::instance()->get_one_by_ID( $att_id );
        //if no contact then bail
        if ( ! $contact instanceof EE_Attendee ) {
            return;
        }
        // does the user have a registration for this event
        $registration = $contact->get_most_recent_registration_for_event($post->ID);

        if( $registration instanceof EE_Registration ) {
            echo '<p style="color:red">You have already registered for this event, and your current registration status is ' . $registration->pretty_status() . '. If you need to request any changes to your registration, please contact the course administrator.</p>';            
            if( is_single() ) {
                remove_filter(
                    'the_content',
                    array('EED_Event_Single', 'event_tickets'),
                    EED_Event_Single::EVENT_TICKETS_PRIORITY,
                    1
                );
            } elseif ( is_archive('espresso_events') ) {
                remove_filter(
                    'the_content',
                    array('EED_Events_Archive', 'event_tickets'),
                    EED_Events_Archive::EVENT_TICKETS_PRIORITY
                );
            }       
        }
    }
}

Visit the row on Git: https://gist.github.com/Pebblo/10669adfeea322ade3d96a38857fb46b

You can add the code from the above to a functions plugin.

See more customizations for the WP User integration in the code snippet library for Event Espresso.


Need to buy a support license for the EE4 WP User integration?
Purchase a support license for the WP User integration for Event Espresso

Need to buy a support license for the EE3 WP User integration?
https://eventespresso.com/product/espresso-members/


Installation for the Event Espresso 3 WP User Integration


This integration requires Event Espresso 3.1.33 or newer. It cannot be used with old versions of Event Espresso 3.

This add-on is a plugin for WordPress and can be installed through your WP dashboard (WP-admin).

Download the latest version of the WP User integration for Event Espresso 3 from your Event Espresso account.

Then login to your  WordPress dashboard (WP-admin) and go to Plugins. Next, click on Add New –> Upload and browse to the plugin on your computer. Then select the zip file and begin the upload process. Wait for the plugin to upload and then click on Activate.

Setup and Configuration for EE3 WP User Integration

Login to your WordPress dashboard. Then go to  Settings –> General. On the next screen, look for the Membership option and place a checkmark next to Anyone can register. Then save changes.

Next, go to  Event Espresso –> Member Settings. This page shows settings that affect the member functionality of this add-on.

Below are the available fields and explanations for each field.

Login page (if different from default WordPress login page) – specify a custom login page for your attendees/registrants
Require login for all events? – your attendees/registrants will only be able to register for an event if they are logged in to your site
Make auto-filled fields editable – allow your registrants/attendees to update their information during registration checkout

Make changes as needed and then click on Save Settings. Note that these changes are optional.

Now you’ll need to give attendees/registrants a way navigate to the registration/log-in page. The default WordPress page for logging in is the same URL you use to log into your WordPress site: example.com/wp-login.php. The registration page URL is example.com/wp-login.php?action=register. You can post these links anywhere on your site. Some people use the built-in meta widget in widgetized areas of the theme. There are also plugins that allow for a little more control over what happens after logging in. An example of this, is the Simple login plugin.

You may want to “brand” the log-in page for your WordPress site. A nice and simple plugin that lets you do this is the Login Logo plugin developed by Mark Jaquith.

Usage for the Event Espresso 3 WP User Integration

The add-on will allow you to set member pricing and non-member pricing. To do this, go to  Event Espresso –> Events Overview. Then click on an existing event or click on Add New if you are creating your first event in Event Espresso. You’ll now be viewing the event editor. Add an event name along with a description and scroll down. You should see a pricing area. Create your pricing options and enter a non-member pricing along with member pricing. Note that both will be required for each pricing option that is created. Then be sure to save changes to your event.

Image

Non-member and Member price fields

Member profiles

The Members add-on uses the WordPress Users –> Your Profile screen to allow members to store their personal information for quick event registration. A special section is added to this screen that has the additional form fields to store address information. After these are filled out and saved, the information will be auto-filled for returning logged in members.

Events profile information fields

My Events Screen

After a member registers for an event, a record of their registrations is available to view on the My Events screen. Here they can review the date and times of the events, and make payments for events they’ve signed up for. If the custom ticket add-on is installed, tickets can be downloaded for each of these events.

Image

My events screen

My Events Shortcode

[ESPRESSO_MY_EVENTS]
espresso_my_events shortcode

This shortcode allows you to create a front facing page for members to see their current and past events.
It has functionality for users to select events that still require payment and allows users to pay, cancel events, as well as perform the standard sort and search functions. Members can also access their profile via this page.

Usage: Create a new post or page in WordPress and add the shortcode and publish. Logged in members will see their details.


Tip: You can use a separate plugin such as S2Member, to hide the page content from non members.

Troubleshooting the Event Espresso 3 WP User Integration

The plugin does not work as expected. Can you help?
Is Event Espresso 3 up to date along with this add-on?

My attendees/registrants are logged out unexpectedly
Enable FORCE_SSL_LOGIN or force SSL across the site to be sure that your members do not get logged out when the site they enter the SSL-encrypted pages. See Administration over SSL for more information.


Need to buy a support license for the EE3 WP User integration?
https://eventespresso.com/product/espresso-members/

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us