Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Mariust

    (@mariust)

    After posting i realised a critical error i made up there.
    Now after some hours i arrived at this, wich should work if i wasnt still missing something:

    add_action('em_event_output_condition', 'my_em_event_output_condition001', 1, 4);
    function my_em_event_output_condition001($replacement, $condition, $match, $EM_Event){
        if( is_object($EM_Event) && preg_match('/^is_attending$/',$condition, $matches) ){
            $EM_Booking = $EM_Event->get_bookings()->has_booking();
            if( is_object($EM_Booking) ){
                $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
            }else{ $replacement = ''; }
        }
        return $replacement;
    }

    Inserting a few alerts into the code tells me that
    if( is_object($EM_Event) && preg_match(‘/^is_attending$/’,$condition, $matches) )
    never returns true. Do i need to include anything important in my functions.php?

Viewing 1 replies (of 1 total)