• Resolved crabbycrabbersen

    (@crabbycrabbersen)


    Hi there,

    I’m using EM_Events::get($args) in my global events search, having set
    $args['search'] = $keyword
    and
    $args['scope'] with a start/end date.

    By doing this, the assigned tags to the events didn’t get searched. How can I include the event’s tags to get searched for $keyword also?

    Thanks!
    Crabby

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • caimin_nwl

    (@caimin_nwl)

    Hi,

    This may help:
    https://pastebin.com/2GiqjWfG

    Thread Starter crabbycrabbersen

    (@crabbycrabbersen)

    Thanks, but that didn’t seem to have influence onto the ::get method…

    caimin_nwl

    (@caimin_nwl)

    Can you explain more about what you’re trying to do?

    Thread Starter crabbycrabbersen

    (@crabbycrabbersen)

    I have a custom coded form on the page to search for events, entering a keyword and/or start/end dates. With the form’s values, I’m querying the events as follows:

    if ($date_from = $_GET['date_von']) {
        $cd = explode('-',$date_from);
        if (!checkdate((int)$cd[1], (int)$cd[2], (int)$cd[0]))
            $date_from = "";
    }
    if ($date_to = $_GET['date_bis']) {
        $cd = explode('-',$date_to);
    
        if (!checkdate((int)$cd[1], (int)$cd[2], (int)$cd[0]))
            $date_to = "";
    }
    
    $args['limit'] = 10;
    $args['search'] = urldecode($_GET['s']);
    $events_count = EM_Events::count($args);
    $args['offset'] = (isset($_REQUEST['pno'])) ? $args['limit'] * $_REQUEST['pno'] : 0;
    $args['page'] = (isset($_REQUEST['pno'])) ? $_REQUEST['pno'] : 1;
    
    if ($date_from)
        if($date_to) {
            if($date_from > $date_to) {
                $t = $date_from;
                $date_from = $date_to;
                $date_to = $t;
            }
            $args['scope'] = $date_from.','.$date_to;
    
        } else
            $args['scope'] = $date_from.',9999-01-01';
    elseif($date_to)
        $args['scope'] = date('Y-m-d').','.$date_to;                
    
    foreach (EM_Events::get($args) as $EM_Event): $WP_Event = get_post($EM_Event->post_id);
    
    //display event
    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can something like $args['tag'] = $keyword

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Include Tags in EM_Events::get’ is closed to new replies.