function em_get_categories_shortcode($args, $format = '') { $args = (array) $args; $args['ajax'] = isset($args['ajax']) ? $args['ajax'] : !defined('EM_AJAX') || EM_AJAX; $args['format'] = $format != '' || empty($args['format']) ? $format : $args['format']; $args['format'] = html_entity_decode($args['format']); //shorcode doesn't accept html $args['orderby'] = !empty($args['orderby']) ? $args['orderby'] : get_option('dbem_categories_default_orderby'); $args['order'] = !empty($args['order']) ? $args['order'] : get_option('dbem_categories_default_order'); $args['limit'] = isset($args['limit']) ? $args['limit'] : get_option('dbem_categories_default_limit'); $args['pagination'] = isset($args['pagination']) ? $args['pagination'] : 1; if (empty($args['format']) && empty($args['format_header']) && empty($args['format_footer'])) { ob_start(); if (!empty($args['ajax'])) { echo '<div class="em-search-ajax">'; } //open AJAX wrapper em_locate_template('templates/categories-list.php', true, array('args' => $args)); if (!empty($args['ajax'])) { echo "</div>"; } //close AJAX wrapper $return = ob_get_clean(); } else { $args['ajax'] = false; $args['page'] = !empty($args['page']) && is_numeric($args['page']) ? $args['page'] : 1; $args['page'] = !empty($_GET['pno']) && is_numeric($_GET['pno']) ? $_GET['pno'] : $args['page']; $return = EM_Categories::output($args); } return $return; }
function em_get_categories_shortcode($args, $format = '') { $args = (array) $args; $args['format'] = $format != '' || empty($args['format']) ? $format : $args['format']; $args['format'] = html_entity_decode($args['format']); //shorcode doesn't accept html $args['orderby'] = !empty($args['orderby']) ? $args['orderby'] : get_option('dbem_categories_default_orderby'); $args['order'] = !empty($args['order']) ? $args['order'] : get_option('dbem_categories_default_order'); return EM_Categories::output($args); }
<?php /* * Default Categories List Template * This page displays a list of locations, called during the em_content() if this is an events list page. * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need. * You can display locations (or whatever) however you wish, there are a few variables made available to you: * * $args - the args passed onto EM_Locations::output() * */ $args = apply_filters('em_content_categories_args', $args); $categories = EM_Categories::get($args); $args['limit'] = get_option('dbem_categories_default_limit'); $args['page'] = !empty($_REQUEST['pno']) && is_numeric($_REQUEST['pno']) ? $_REQUEST['pno'] : 1; if (count($categories) > 0) { echo EM_Categories::output($categories, $args); } else { echo get_option('dbem_no_categories_message'); }