Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active November 8, 2016 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/c68d410fcd53cf2c65b60c93f04b1d9e to your computer and use it in GitHub Desktop.
Save joshfeck/c68d410fcd53cf2c65b60c93f04b1d9e to your computer and use it in GitHub Desktop.
Adds a log in button to the event page and the page that has the registration form for EE4. From: https://eventespresso.com/topic/loginregister-before-purchase/
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function my_add_login_message_button_to_registration() {
if ( ! is_user_logged_in() ) {
$button = '<a class="ee-roundish ee-orange ee-button float-right ee-wpuser-login-button" href="' . wp_login_url( get_permalink() ) . '">' . __( 'Login', 'event_espresso' ) . '</a>';
echo '<p>If you already have an account, please login before continuing. ' . $button . '</p>';
}
}
add_action( 'AHEE__attendee_information__reg_step_start', 'my_add_login_message_button_to_registration' ); // this is okay, but their reg form will not be autofilled
add_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', 'my_add_login_message_button_to_registration' ); // this is right after the ticket selector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment