Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter seannittner

    (@seannittner)

    Currently the file looks like:

    <?php
    /* @var $EM_Event EM_Event */
    $people = array();
    foreach($EM_Event->get_bookings() as $EM_Booking){
    	$people[$EM_Booking->person->ID] = $EM_Booking->person;
    }
    ?>
    	<?php foreach($people as $EM_Person): ?>
    
    <?php $user_info = get_userdata($EM_Person->ID);
          echo $user_info->first_name .  " " . $user_info->last_name . "\n"; ?>
    
    	<?php endforeach; ?>

    I’m thinking I should change this line to say “if booking_status=1” but I’m not sure how to do that:

    foreach($EM_Event->get_bookings() as $EM_Booking)

    This might work:

    foreach($EM_Event->get_bookings() as $EM_Booking){
    	if ($EM_Booking->status){
    		$people[$EM_Booking->person->ID] = $EM_Booking->person;
    	}
    }
    Thread Starter seannittner

    (@seannittner)

    Thanks agelonwl,

    With just a minor tweak, it worked. Here was was the final code:

    foreach($EM_Event->get_bookings() as $EM_Booking){
    	if (($EM_Booking->status)==1){
    		$people[$EM_Booking->person->ID] = $EM_Booking->person;
    	}
    }

    that’s great then. please mark it as resolve

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    graet, and using EM objects as intended ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Events Manager] Show only "confirmed" bookings in #_Attendees’ is closed to new replies.