• Resolved kty_cdm

    (@kty_cdm)


    Hi,

    Thank you for this great plugin! I hope you could help me with a question that I have.
    I need to retrieve all the events and the persons ( the emails addresses ) who signed up for events.
    For that I use this code:

    $EM_Events = EM_Events::get( array( 'scope' => 'all' ) );
    	foreach ( $EM_Events as $key => $EM_Event ) {
    		$EM_Bookings = $EM_Event->get_bookings(true);
                    $obj[ $key ]['event'] = $EM_Event;
            }
           echo json_encode( $obj );

    The problem with this is that inside the “bookings” property that is retrieved there is “person” property which stores multiple information about the user, including the encoded password for that user. How can I prevent from displaying that sensitive information?

    Thank you in advance for all the help!

    https://www.ads-software.com/plugins/events-manager/

Viewing 1 replies (of 1 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    maybe you can try something like

    $EM_Events = EM_Events::get( array( 'scope' => 'all' ) );
    foreach ($EM_Events as $EM_Event){
    
      echo $EM_Event->event_name. '<br>';
    
      foreach ($EM_Bookings as $EM_Booking){
        echo $EM_Booking->get_person()->user_email. '<br>';
      }  
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘programmatically retrieve all the events, bookings and persons’ is closed to new replies.