function mc_list_events() { global $wpdb; $mcdb = $wpdb; if (current_user_can('mc_approve_events') || current_user_can('mc_manage_events') || current_user_can('mc_add_events')) { $action = !empty($_POST['event_action']) ? $_POST['event_action'] : ''; $event_id = !empty($_POST['event_id']) ? $_POST['event_id'] : ''; if ($action == 'delete') { $message = mc_delete_event($event_id); echo $message; } if (isset($_GET['order'])) { $sortdir = isset($_GET['order']) && $_GET['order'] == 'ASC' ? 'ASC' : 'default'; $sortdir = isset($_GET['order']) && $_GET['order'] == 'DESC' ? 'DESC' : $sortdir; } else { $sortdir = 'default'; } $default_direction = get_option('mc_default_direction') == '' ? 'ASC' : get_option('mc_default_direction'); $sortbydirection = $sortdir == 'default' ? $default_direction : $sortdir; $sortby = isset($_GET['sort']) ? $_GET['sort'] : get_option('mc_default_sort'); if (empty($sortby)) { $sortbyvalue = 'event_begin'; } else { switch ($sortby) { case 1: $sortbyvalue = 'event_ID'; break; case 2: $sortbyvalue = 'event_title'; break; case 3: $sortbyvalue = 'event_desc'; break; case 4: $sortbyvalue = "event_begin {$sortbydirection}, event_time"; break; case 5: $sortbyvalue = 'event_author'; break; case 6: $sortbyvalue = 'event_category'; break; case 7: $sortbyvalue = 'event_label'; break; default: $sortbyvalue = "event_begin {$sortbydirection}, event_time"; } } $sorting = $sortbydirection == 'DESC' ? "&order=ASC" : '&order=DESC'; $allow_filters = true; $status = isset($_GET['limit']) ? $_GET['limit'] : 'all'; $restrict = isset($_GET['restrict']) ? $_GET['restrict'] : 'all'; switch ($status) { case 'all': $limit = ''; break; case 'reserved': $limit = 'WHERE event_approved <> 1'; break; case 'published': $limit = 'WHERE event_approved = 1'; break; default: $limit = ''; } switch ($restrict) { case 'all': $filter = ''; break; case 'where': $filter = isset($_GET['filter']) ? $_GET['filter'] : ''; $restrict = "event_label"; break; case 'author': $filter = isset($_GET['filter']) ? (int) $_GET['filter'] : ''; $restrict = "event_author"; break; case 'category': $filter = isset($_GET['filter']) ? (int) $_GET['filter'] : ''; $restrict = "event_category"; break; case 'flagged': $filter = isset($_GET['filter']) ? (int) $_GET['filter'] : ''; $restrict = "event_flagged"; break; default: $filter = ''; } if (!current_user_can('mc_manage_events') && !current_user_can('mc_approve_events')) { $restrict = 'event_author'; $filter = get_current_user_id(); $allow_filters = false; } $filter = esc_sql(urldecode($filter)); if ($restrict == "event_label") { $filter = "'{$filter}'"; } if ($limit == '' && $filter != '') { $limit = "WHERE {$restrict} = {$filter}"; } else { if ($limit != '' && $filter != '') { $limit .= "AND {$restrict} = {$filter}"; } } if ($filter == '' || !$allow_filters) { $filtered = ""; } else { $filtered = "<span class='dashicons dashicons-no'></span><a href='" . admin_url('admin.php?page=my-calendar-manage') . "'>" . __('Clear filters', 'my-calendar') . "</a>"; } $current = empty($_GET['paged']) ? 1 : intval($_GET['paged']); $user = get_current_user_id(); $screen = get_current_screen(); $option = $screen->get_option('per_page', 'option'); $items_per_page = get_user_meta($user, $option, true); if (empty($items_per_page) || $items_per_page < 1) { $items_per_page = $screen->get_option('per_page', 'default'); } // default limits if ($limit == '') { $limit .= $restrict != 'event_flagged' ? " WHERE event_flagged = 0" : ''; } else { $limit .= $restrict != 'event_flagged' ? " AND event_flagged = 0" : ''; } if (isset($_POST['mcs'])) { $query = $_POST['mcs']; $limit .= mc_prepare_search_query($query); } $limit .= $restrict != 'archived' ? " AND event_status = 1" : ' AND event_status = 0'; $events = $mcdb->get_results("SELECT SQL_CALC_FOUND_ROWS event_id FROM " . my_calendar_table() . " {$limit} ORDER BY {$sortbyvalue} {$sortbydirection} LIMIT " . ($current - 1) * $items_per_page . ", " . $items_per_page); $found_rows = $wpdb->get_col("SELECT FOUND_ROWS();"); $items = $found_rows[0]; if ((function_exists('akismet_http_post') || function_exists('bs_checker')) && $allow_filters) { ?> <ul class="links"> <li> <a <?php echo isset($_GET['restrict']) && $_GET['restrict'] == 'flagged' ? 'class="active-link"' : ''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&restrict=flagged&filter=1'); ?> "><?php _e('Spam', 'my-calendar'); ?> </a> </li> </ul><?php } ?> <div class='mc-search'> <form action="<?php echo esc_url(add_query_arg($_GET, admin_url('admin.php'))); ?> " method="post"> <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?> "/> </div> <div> <label for="mc_search" class='screen-reader-text'><?php _e('Search', 'my-calendar'); ?> </label> <input type='text' role='search' name='mcs' id='mc_search' value='<?php if (isset($_POST['mcs'])) { esc_attr_e($_POST['mcs']); } ?> '/> <input type='submit' value='<?php _e('Search Events', 'my-calendar'); ?> ' class='button-secondary'/> </div> </form> </div> <?php if (get_option('mc_event_approve') == 'true') { ?> <ul class="links"> <li> <a <?php echo isset($_GET['limit']) && $_GET['limit'] == 'published' ? 'class="active-link"' : ''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&limit=published'); ?> "><?php _e('Published', 'my-calendar'); ?> </a> </li> <li> <a <?php echo isset($_GET['limit']) && $_GET['limit'] == 'reserved' ? 'class="active-link"' : ''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&limit=reserved'); ?> "><?php _e('Reserved', 'my-calendar'); ?> </a> </li> <li> <a <?php echo isset($_GET['limit']) && $_GET['limit'] == 'all' || !isset($_GET['limit']) ? 'class="active-link"' : ''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&restrict=archived'); ?> "><?php _e('Archived', 'my-calendar'); ?> </a> </li> <li> <a <?php echo isset($_GET['limit']) && $_GET['limit'] == 'all' || !isset($_GET['limit']) ? 'class="active-link"' : ''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&limit=all'); ?> "><?php _e('All', 'my-calendar'); ?> </a> </li> </ul><?php } echo $filtered; $num_pages = ceil($items / $items_per_page); if ($num_pages > 1) { $page_links = paginate_links(array('base' => add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => __('« Previous<span class="screen-reader-text"> Events</span>', 'my-calendar'), 'next_text' => __('Next<span class="screen-reader-text"> Events</span> »', 'my-calendar'), 'total' => $num_pages, 'current' => $current, 'mid_size' => 1)); printf("<div class='tablenav'><div class='tablenav-pages'>%s</div></div>", $page_links); } if (!empty($events)) { ?> <form action="<?php echo esc_url(add_query_arg($_GET, admin_url('admin.php'))); ?> " method="post"> <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?> "/> </div> <div class='mc-actions'> <input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e('Delete events', 'my-calendar'); ?> "/> <?php if (current_user_can('mc_approve_events')) { ?> <input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e('Approve events', 'my-calendar'); ?> "/> <?php } ?> <?php if (!(isset($_GET['restrict']) && $_GET['restrict'] == 'archived')) { ?> <input type="submit" class="button-secondary mc-archive" name="mass_archive" value="<?php _e('Archive events', 'my-calendar'); ?> "/> <?php } else { ?> <input type="submit" class="button-secondary mc-archive" name="mass_undo_archive" value="<?php _e('Remove from archive', 'my-calendar'); ?> "/> <?php } ?> </div> <table class="widefat wp-list-table" id="my-calendar-admin-table"> <thead> <tr> <th scope="col" style="width: 50px;"><input type='checkbox' class='selectall' id='mass_edit'/> <label for='mass_edit' class="screen-reader-text"><?php _e('Check/Uncheck all', 'my-calendar'); ?> </label> <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&sort=1{$sorting}"); ?> "><?php _e('ID', 'my-calendar'); ?> </a> </th> <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&sort=2{$sorting}"); ?> "><?php _e('Title', 'my-calendar'); ?> </a> </th> <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&sort=7{$sorting}"); ?> "><?php _e('Location', 'my-calendar'); ?> </a> </th> <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&sort=4{$sorting}"); ?> "><?php _e('Date/Time', 'my-calendar'); ?> </a> </th> <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&sort=5{$sorting}"); ?> "><?php _e('Author', 'my-calendar'); ?> </a> </th> <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&sort=6{$sorting}"); ?> "><?php _e('Category', 'my-calendar'); ?> </a> </th> </tr> </thead> <?php $class = ''; $sql = "SELECT * FROM " . my_calendar_categories_table(); $categories = $mcdb->get_results($sql); foreach (array_keys($events) as $key) { $event =& $events[$key]; $event = mc_get_event_core($event->event_id); if (!is_object($event)) { continue; } $class = $class == 'alternate' ? 'even' : 'alternate'; $pending = $event->event_approved == 0 ? 'pending' : ''; $author = $event->event_author != 0 ? get_userdata($event->event_author) : 'Public Submitter'; if ($event->event_flagged == 1 && (isset($_GET['restrict']) && $_GET['restrict'] == 'flagged')) { $spam = 'spam'; $pending = ''; $spam_label = '<strong>' . __('Possible spam', 'my-calendar') . ':</strong> '; } else { $spam = ''; $spam_label = ''; } $edit_url = admin_url("admin.php?page=my-calendar&mode=edit&event_id={$event->event_id}"); $copy_url = admin_url("admin.php?page=my-calendar&mode=copy&event_id={$event->event_id}"); $view_url = mc_get_details_link($event); $group_url = admin_url("admin.php?page=my-calendar-groups&mode=edit&event_id={$event->event_id}&group_id={$event->event_group_id}"); $delete_url = admin_url("admin.php?page=my-calendar-manage&mode=delete&event_id={$event->event_id}"); $check = mc_test_occurrence_overlap($event, true); $problem = $check != '' ? 'problem' : ''; if (current_user_can('mc_manage_events') || current_user_can('mc_approve_events') || mc_can_edit_event($event->event_id)) { ?> <tr class="<?php echo "{$class} {$spam} {$pending} {$problem}"; ?> "> <th scope="row"> <input type="checkbox" value="<?php echo $event->event_id; ?> " name="mass_edit[]" id="mc<?php echo $event->event_id; ?> " <?php echo $event->event_flagged == 1 ? 'checked="checked"' : ''; ?> /> <label for="mc<?php echo $event->event_id; ?> "><?php echo $event->event_id; ?> </label> </th> <td title="<?php echo esc_attr(substr(strip_tags(stripslashes($event->event_desc)), 0, 240)); ?> "> <strong><?php if (mc_can_edit_event($event->event_id)) { ?> <a href="<?php echo $edit_url; ?> " class='edit'> <?php } ?> <?php echo $spam_label; echo strip_tags(stripslashes($event->event_title)); ?> <?php if (mc_can_edit_event($event->event_id)) { echo "</a>"; if ($check != '') { echo '<br /><strong class="error">' . sprintf(__('There is a problem with this event. <a href="%s">View</a>', 'my-calendar'), $edit_url) . '</strong>'; } } ?> </strong> <div class='row-actions' style="visibility:visible;"> <?php if (mc_event_published($event)) { ?> <a href="<?php echo $view_url; ?> " class='view'><?php _e('View', 'my-calendar'); ?> </a> | <?php } ?> <a href="<?php echo $copy_url; ?> " class='copy'><?php _e('Copy', 'my-calendar'); ?> </a> | <?php if (mc_can_edit_event($event->event_id)) { ?> <a href="<?php echo $edit_url; ?> " class='edit'><?php _e('Edit', 'my-calendar'); ?> </a> <?php if (mc_event_is_grouped($event->event_group_id)) { ?> | <a href="<?php echo $group_url; ?> " class='edit group'><?php _e('Edit Group', 'my-calendar'); ?> </a> <?php } ?> | <a href="<?php echo $delete_url; ?> " class="delete"><?php _e('Delete', 'my-calendar'); ?> </a> <?php } else { _e("Not editable.", 'my-calendar'); } if (get_option('mc_event_approve') == 'true') { ?> | <?php if (current_user_can('mc_approve_events')) { // Added by Roland P. if ($event->event_approved == '1') { $mo = 'reject'; $te = __('Reject', 'my-calendar'); } else { $mo = 'publish'; $te = __('Approve', 'my-calendar'); } ?> <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&mode={$mo}&event_id={$event->event_id}"); ?> " class='<?php echo $mo; ?> '><?php echo $te; ?> </a> <?php } else { switch ($event->event_approved) { case 1: _e('Approved', 'my-calendar'); break; case 2: _e('Rejected', 'my-calendar'); break; default: _e('Awaiting Approval', 'my-calendar'); } } } ?> </div> </td> <td> <?php if ($event->event_label != '') { ?> <a class='mc_filter' href='<?php $elabel = urlencode($event->event_label); echo admin_url("admin.php?page=my-calendar-manage&filter={$elabel}&restrict=where"); ?> ' title="<?php _e('Filter by location', 'my-calendar'); ?> "><span class="screen-reader-text"><?php _e('Show only: ', 'my-calendar'); ?> </span><?php echo strip_tags(stripslashes($event->event_label)); ?> </a><?php } ?> </td> <?php if ($event->event_endtime != "23:59:59") { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = mc_notime_label($event); } ?> <td><?php $date_format = get_option('mc_date_format') == '' ? get_option('date_format') : get_option('mc_date_format'); $begin = date_i18n($date_format, strtotime($event->event_begin)); echo "{$begin}, {$eventTime}"; ?> <div class="recurs"> <strong><?php _e('Recurs', 'my-calendar'); ?> </strong> <?php $recurs = str_split($event->event_recur, 1); $recur = $recurs[0]; $every = isset($recurs[1]) ? $recurs[1] : 1; // Interpret the DB values into something human readable switch ($recur) { case 'S': _e('Never', 'my-calendar'); break; case 'D': $every == 1 ? _e('Daily', 'my-calendar') : printf(__('Every %d days', 'my-calendar'), $every); break; case 'E': $every == 1 ? _e('Weekdays', 'my-calendar') : printf(__('Every %d weekdays', 'my-calendar'), $every); break; case 'W': $every == 1 ? _e('Weekly', 'my-calendar') : printf(__('Every %d weeks', 'my-calendar'), $every); break; case 'B': _e('Bi-Weekly', 'my-calendar'); break; case 'M': $every == 1 ? _e('Monthly (by date)', 'my-calendar') : printf(__('Every %d months (by date)', 'my-calendar'), $every); break; case 'U': _e('Monthly (by day)', 'my-calendar'); break; case 'Y': $every == 1 ? _e('Yearly', 'my-calendar') : printf(__('Every %d years', 'my-calendar'), $every); break; } $eternity = _mc_increment_values($recur); if ($recur == 'S') { } else { if ($event->event_repeats > 0) { printf(__('– %d Times', 'my-calendar'), $event->event_repeats); } else { if ($eternity) { printf(__('– %d Times', 'my-calendar'), $eternity); } } } ?> </div> </td> <td><a class='mc_filter' href="<?php $auth = is_object($author) ? $author->ID : 0; echo admin_url("admin.php?page=my-calendar-manage&filter={$auth}&restrict=author"); ?> " title="<?php _e('Filter by author', 'my-calendar'); ?> "><span class="screen-reader-text"><?php _e('Show only: ', 'my-calendar'); ?> </span><?php echo is_object($author) ? $author->display_name : $author; ?> </a></td> <?php if (!$event->event_category) { // events *must* have a category mc_update_event('event_category', 1, $event->event_id, '%d'); } $color = strip_tags(mc_get_category_detail($event->event_category, 'category_color')); ?> <td> <div class="category-color" style="background-color:<?php echo strpos($color, '#') !== 0 ? '#' : ''; echo $color; ?> ;"> </div> <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage&filter={$event->event_category}&restrict=category"); ?> ' title="<?php _e('Filter by category', 'my-calendar'); ?> "><span class="screen-reader-text"><?php _e('Show only: ', 'my-calendar'); ?> </span><?php echo mc_kses_post(mc_get_category_detail($event->event_category, 'category_name')); ?> </a></td> </tr> <?php } } ?> </table> <p> <input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e('Delete events', 'my-calendar'); ?> "/> <?php if (current_user_can('mc_approve_events')) { ?> <input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e('Approve events', 'my-calendar'); ?> "/> <?php } ?> <?php if (!(isset($_GET['restrict']) && $_GET['restrict'] == 'archived')) { ?> <input type="submit" class="button-secondary mc-archive" name="mass_archive" value="<?php _e('Archive events', 'my-calendar'); ?> "/> <?php } ?> </p> <p> <?php if (!(isset($_GET['restrict']) && $_GET['restrict'] == 'archived')) { ?> <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage&restrict=archived"); ?> '><?php _e('View Archived Events', 'my-calendar'); ?> </a> <?php } else { ?> <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage"); ?> '><?php _e('Return to Manage Events', 'my-calendar'); ?> </a> <?php } ?> </p> </form> <?php } else { ?> <p class='mc-none'><?php _e("There are no events in the database meeting your current criteria.", 'my-calendar'); ?> </p><?php } } }
function my_calendar_grab_events($from, $to, $category = null, $ltype = '', $lvalue = '', $source = 'calendar', $author = null, $host = null, $holidays = null, $search = '') { global $wpdb; $mcdb = $wpdb; if (get_option('mc_remote') == 'true' && function_exists('mc_remote_db')) { $mcdb = mc_remote_db(); } if ($holidays === null) { if (isset($_GET['mcat'])) { $ccategory = $_GET['mcat']; } else { $ccategory = $category; } } else { $ccategory = $category; } if (isset($_GET['ltype'])) { $cltype = $_GET['ltype']; } else { $cltype = $ltype; } if (isset($_GET['loc'])) { $clvalue = $_GET['loc']; } else { $clvalue = $lvalue; } if (isset($_GET['mc_auth'])) { $clauth = $_GET['mc_auth']; } else { $clauth = $author; } if (isset($_GET['mc_host'])) { $clhost = $_GET['mc_host']; } else { $clhost = $host; } if ($ccategory == '') { $ccategory = 'all'; } if ($clvalue == '') { $clvalue = 'all'; } if ($cltype == '') { $cltype = 'all'; } if ($clvalue == 'all') { $cltype = 'all'; } if ($clauth == '') { $clauth = 'all'; } if ($clhost == '') { $clhost = 'all'; } if (!mc_checkdate($from) || !mc_checkdate($to)) { return array(); } // not valid dates $caching = apply_filters('mc_caching_enabled', false, $ccategory, $ltype, $lvalue, $author, $host); $hash = md5($from . $to . $ccategory . $cltype . $clvalue . $clauth . $clhost); if ($source != 'upcoming') { // no caching on upcoming events by days widgets or lists if ($caching) { $output = mc_check_cache($ccategory, $cltype, $clvalue, $clauth, $clhost, $hash); if ($output && $output != 'empty') { return $output; } if ($output == 'empty') { return array(); } } } $select_category = $ccategory != 'all' ? mc_select_category($ccategory) : ''; $select_author = $clauth != 'all' ? mc_select_author($clauth) : ''; $select_host = $clhost != 'all' ? mc_select_host($clhost) : ''; $select_location = mc_limit_string('grab', $cltype, $clvalue); if ($caching && $source != 'upcoming') { $select_category = ''; $select_location = ''; $select_author = ''; $select_host = ''; } // if caching, then need all categories/locations in cache. UNLESS this is an upcoming events list $arr_events = array(); $limit_string = "event_flagged <> 1 AND event_approved = 1"; $search = mc_prepare_search_query($search); $event_query = "SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end\n\t\t\t\t\tFROM " . MY_CALENDAR_EVENTS_TABLE . " \n\t\t\t\t\tJOIN " . MY_CALENDAR_TABLE . "\n\t\t\t\t\tON (event_id=occur_event_id) \t\t\t\t\t\n\t\t\t\t\tJOIN " . MY_CALENDAR_CATEGORIES_TABLE . " \n\t\t\t\t\tON (event_category=category_id) \n\t\t\t\t\tWHERE {$select_category} {$select_location} {$select_author} {$select_host} {$limit_string} {$search} \n\t\t\t\t\tAND ( DATE(occur_begin) BETWEEN '{$from} 00:00:00' AND '{$to} 23:59:59' \n\t\t\t\t\t\tOR DATE(occur_end) BETWEEN '{$from} 00:00:00' AND '{$to} 23:59:59' \n\t\t\t\t\t\tOR ( DATE('{$from}') BETWEEN DATE(occur_begin) AND DATE(occur_end) ) \n\t\t\t\t\t\tOR ( DATE('{$to}') BETWEEN DATE(occur_begin) AND DATE(occur_end) ) ) \n\t\t\t\t\tORDER BY " . apply_filters('mc_primary_sort', 'occur_begin') . ", " . apply_filters('mc_secondary_sort', 'event_title ASC'); $events = $mcdb->get_results($event_query); if (!empty($events)) { foreach (array_keys($events) as $key) { $event =& $events[$key]; $arr_events[] = $event; } } if ($source != 'upcoming' && $caching) { $new_cache = mc_create_cache($arr_events, $hash, $category, $ltype, $lvalue, $author, $host); if ($new_cache) { $output = mc_check_cache($ccategory, $cltype, $clvalue, $clauth, $clhost, $hash); return $output; } else { // need to clean cache if the cache is maxed. return mc_clean_cache($arr_events, $ccategory, $cltype, $clvalue, $clauth, $clhost); } } else { return $arr_events; } }
function mc_search_results($query) { $before = apply_filters('mc_past_search_results', 0, 'basic'); $after = apply_filters('mc_future_search_results', 10, 'basic'); // return only future events, nearest 10 if (is_string($query)) { $search = mc_prepare_search_query($query); $term = $query; } else { $search = apply_filters('mc_advanced_search', '', $query); $term = $query['mcs']; $before = apply_filters('mc_past_search_results', 10, 'advanced'); $after = apply_filters('mc_future_search_results', 10, 'advanced'); } $event_array = mc_get_search_results($search); //$event_array = mc_flatten_array( $event_array ); if (!empty($event_array)) { $template = '<strong>{date}</strong> {title} {details}'; $template = apply_filters('mc_search_template', $template); // no filters parameter prevents infinite looping on the_content filters. $output = mc_produce_upcoming_events($event_array, $template, 'list', 'ASC', 0, $before, $after, 'yes', 'nofilters'); } else { $output = apply_filters('mc_search_no_results', "<li class='no-results'>" . __('Sorry, your search produced no results.', 'my-calendar') . "</li>"); } $header = apply_filters('mc_search_before', '<ol class="mc-search-results">', $term); $footer = apply_filters('mc_search_after', '</ol>', $term); return $header . $output . $footer; }