You are logged in as xxx@xxxxx.xx Not you?

WordPress Event Management, Calendars & Registration Forums General Question You are logged in as xxx@xxxxx.xx Not you?

This topic contains 13 replies, has 2 voices, and was last updated by  Stephen Harris 7 years, 3 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #25154

    I have tried to remove the line “You are logged in as….” following the description on https://wp-event-organiser.com/blog/tutorial/where-should-i-put-code-from-the-tutorials/ and https://wp-event-organiser.com/forums/topic/security-you-are-logged-in-as-xxxxxxxx-xx-not-you/. I have add the snippet to my child functions.php: add_filter( ‘eventorganiser_fes_form_display_notices’, function( $notices ) {
    unset( $notices[‘logged-in-as’] ); //remove logged-in-as notice
    return $notices;
    } );

    THe line is not gone?

    /Camilla

    CAS A/S Camilla Nielsen
    #25186

    Hi Camilla,

    That is for FES extension. For Pro you’ll want ot use the eventorganiser_booking_form_form_display_notices filter instead.

    Stephen Harris
    #25188

    Ok thanks – now the notice is hidden, but I want to show the form that shows when people are not logged in?

    CAS A/S Camilla Nielsen
    #25189

    You can’t unfortunately. The name and email fields are removed as the booking is assigned to the logged-in user.

    Stephen Harris
    #25192

    Ok – then I need to change the text and what if I want to add both email and name?

    I have used following code:

    //Change the logged-in notice to use display name rather than e-mail
    if ( isset( $notices['logged-in'] ) ) {
        $current_user = wp_get_current_user();
        $notices['logged-in'] = sprintf(
            __( 'Du er logget ind og bestiller som %s', 'eventorganiserp' ),
            esc_attr( $current_user->display_name ),
            esc_url( wp_logout_url( get_permalink() ) )
        );
    }
    
    CAS A/S Camilla Nielsen
    #25195

    Certainly:

    //Change the logged-in notice to use display name rather than e-mail
    if ( isset( $notices['logged-in'] ) ) {
        $current_user = wp_get_current_user();
        $notices['logged-in'] = sprintf(
            __( 'Du er logget ind og bestiller som %s (%s)', 'eventorganiserp' ),
            esc_attr( $current_user->display_name ),
            esc_attr( $current_user->user_email )
        );
    }
    
    Stephen Harris
    #25230

    Hi – something is wrong – can you tell me what?

    add_filter( 'eventorganiser_booking_form_form_display_notices', 'my_booking_form_notices', 10, 2 ); function my_booking_form_notices( $notices, $booking_form_view ) {
    
    //Change the logged-in notice to use display name rather than e-mail if ( isset( $notices['logged-in'] ) ) { $current_user = wp_get_current_user(); $notices['logged-in'] = sprintf( __( 'Du er logget ind og bestiller som %s (%s)', 'eventorganiserp' ), esc_attr( $current_user->display_name ), esc_attr( $current_user->user_email ) ); }
    
        //Remove the prior booking notice:
        unset( $notices['prior-booking'] );
    
        //Remove the prior booking notice:
        //unset( $notices['logged-in'] );
    
        return $notices; }
    
    • This reply was modified 7 years, 3 months ago by  CAS A/S Camilla Nielsen.
    CAS A/S Camilla Nielsen
    #25233

    All the code is on online, following a comment. So its commented out.

    Try laying it out as in my previous example.

    Stephen Harris
    #25235

    Thanks 🙂

    CAS A/S Camilla Nielsen
    #25236

    How do I change this text – appearing when I made a booking?
    Thank you for your booking. You shall receive an e-mail containing your tickets once we have confirmed payment

    CAS A/S Camilla Nielsen
    #25245

    As follows:

    add_filter( 'eventorganiser_pro_get_option_booking_complete_message_offline', function( $message ) {
        return 'new message';
    } );
    
    Stephen Harris
    #25249

    And where do I change the words?

    CAS A/S Camilla Nielsen
    #25250

    Another question – if I would like to receive a notification mail when someone booked a ticket, where do I put my email?

    CAS A/S Camilla Nielsen
    #25262

    You replace ‘new message’ with whatever message you desire.

    The site admin gets notified (if such notifications are enabled). There are filters available to alter that behaviour, there’s also an extension which adds a UI option. You can find both here: http://docs.wp-event-organiser.com/bookings/notification-emails/

    Stephen Harris
Viewing 14 posts - 1 through 14 (of 14 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.