本文整理汇总了PHP中EM_Locations::output方法的典型用法代码示例。如果您正苦于以下问题:PHP EM_Locations::output方法的具体用法?PHP EM_Locations::output怎么用?PHP EM_Locations::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EM_Locations
的用法示例。
在下文中一共展示了EM_Locations::output方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: em_get_locations
/**
* Returns a html list of locations filtered by the array or query-string of arguments supplied.
* @param array|string $args
* @return string
*/
function em_get_locations($args = array())
{
if (is_string($args) && strpos($args, "=")) {
// allows the use of arguments without breaking the legacy code
$args = wp_parse_args($args, array());
} else {
$args = (array) $args;
}
$args['ajax'] = isset($args['ajax']) ? $args['ajax'] : !defined('EM_AJAX') || EM_AJAX;
$args['limit'] = !empty($args['limit']) ? $args['limit'] : get_option('dbem_locations_default_limit');
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/locations-list.php', true, array('args' => $args));
if (!empty($args['ajax'])) {
echo "</div>";
}
//close AJAX wrapper
$return = ob_get_clean();
} else {
//no ajax allowed with custom on-the-fly formats
$return = EM_Locations::output($args);
}
return $return;
}
示例2: em_get_locations
/**
* Returns a html list of locations filtered by the array or query-string of arguments supplied.
* @param array|string $args
* @return string
*/
function em_get_locations($args = array())
{
if (strpos($args, "=")) {
// allows the use of arguments without breaking the legacy code
$defaults = EM_Locations::get_default_search();
$args = wp_parse_args($args, $defaults);
}
return EM_Locations::output($args);
}
示例3: em_get_locations_list_shortcode
/**
* Returns list of locations according to given specifications. Accepts any location query attribute.
*/
function em_get_locations_list_shortcode($atts, $format = '')
{
$atts = (array) $atts;
$atts['format'] = $format != '' || empty($atts['format']) ? $format : $atts['format'];
$atts['format'] = html_entity_decode($atts['format']);
//shorcode doesn't accept html
$atts['page'] = !empty($atts['page']) && is_numeric($atts['page']) ? $atts['page'] : 1;
$atts['page'] = !empty($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : $atts['page'];
return EM_Locations::output($atts);
}
示例4: em_get_locations_list_shortcode
/**
* Returns list of locations according to given specifications. Accepts any location query attribute.
*/
function em_get_locations_list_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['limit'] = isset($args['limit']) ? $args['limit'] : get_option('dbem_locations_default_limit');
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/locations-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_Locations::output($args);
}
return $return;
}
示例5: get_option
<?php
/*
* Default Location 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()
*
*/
$locations = EM_Locations::get(apply_filters('em_content_locations_args', $args));
$args['limit'] = get_option('dbem_events_default_limit');
$args['page'] = !empty($_REQUEST['page']) && is_numeric($_REQUEST['page']) ? $_REQUEST['page'] : 1;
if (count($locations) > 0) {
echo EM_Locations::output($locations, $args);
} else {
echo get_option('dbem_no_locations_message');
}
示例6: get_option
<?php
/*
* Default Location 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['limit'] = get_option('dbem_locations_default_limit');
$args['page'] = !empty($_REQUEST['pno']) && is_numeric($_REQUEST['pno']) ? $_REQUEST['pno'] : 1;
$args['offset'] = ($args['page'] - 1) * $args['limit'];
$args['pagination'] = true;
echo EM_Locations::output(apply_filters('em_content_locations_args', $args));