Support

Home Forums Event Espresso Premium Minimum Attendees Reply To: Minimum Attendees

Reply To: Minimum Attendees

Author Replies
Josh # Posted on April 25, 2018 at 8:43 am

Hi Fran,

Yes, you can do this instead:

add_filter(
    'FHEE__espresso_list_of_event_dates__datetime_html', 
    'ee_display_datetime_registration_counts', 
    20, 
    2
);

function ee_display_datetime_registration_counts($html, $datetime){
    if(!current_user_can('ee_edit_events')){
        return $html; // get out!
    }
    $count_regs_for_this_datetime = EEM_Registration::instance()->count(
        array(
            array(
                'REG_deleted'              => 0,
                'Ticket.Datetime.DTT_ID'   => $datetime->ID(),
            ),
           'default_where_conditions' => 'this_model_only'
        )
    );
    $style = 'background-color:#efefef; text-align:center;';
    $style .= 'padding:1em 0; margin:1em 1em 1em 0;';
    $style .= 'font-weight:bold;';    
    $html .= '<div style="'.$style.'" class="ee-reg-count">Number of Regisistrations: ';
    $html .= $count_regs_for_this_datetime . '</div>';
    return $html;
}
Do NOT follow this link or you will be banned from the site!