Esempio n. 1
0
/**
 * Returns a html list of events filtered by the array or query-string of arguments supplied. 
 * @param array|string $args
 * @return string
 */
function em_get_events($args = array())
{
    if (is_string($args) && strpos($args, "=")) {
        // allows the use of arguments without breaking the legacy code
        $defaults = EM_Events::get_default_search();
        $args = wp_parse_args($args, $defaults);
    }
    return EM_Events::output($args);
}
/**
 * TOTALLY DEPRECIATED (NOT ALTERNATIVE TAG) - Just use EM_Events::output, see below
 * @param unknown_type $limit
 * @param unknown_type $scope
 * @param unknown_type $order
 * @param unknown_type $format
 * @param unknown_type $echo
 * @param unknown_type $category
 * @return unknown_type
 */
function dbem_get_events_list($limit = "10", $scope = "future", $order = "ASC", $format = '', $echo = 1, $category = '')
{
    if (strpos($limit, "=")) {
        // allows the use of arguments without breaking the legacy code
        $defaults = EM_Events::get_default_search();
        $r = wp_parse_args($limit, $defaults);
        extract($r, EXTR_OVERWRITE);
    }
    $return = EM_Events::output(array('limit' => $limit, 'scope' => $scope, 'order' => $order, 'format' => $format, 'category' => $category));
    if ($echo) {
        echo $return;
    }
    return $return;
}