本文整理匯總了PHP中Property::getLongitude方法的典型用法代碼示例。如果您正苦於以下問題:PHP Property::getLongitude方法的具體用法?PHP Property::getLongitude怎麽用?PHP Property::getLongitude使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Property
的用法示例。
在下文中一共展示了Property::getLongitude方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: searchProperties
public static function searchProperties($args = array())
{
$key = md5(serialize($args));
if (!isset($args['ignore_sticky_posts'])) {
$args['ignore_sticky_posts'] = true;
}
$_properties = wp_cache_get($key, THEME_NAME);
$found_posts = 0;
if (!$_properties) {
$curr_lang = estetico_surpress_wpml_query_before();
$properties = new WP_Query($args);
if (isset($args['debug'])) {
var_dump($properties);
}
estetico_surpress_wpml_query_after($curr_lang);
$found_posts = $properties->found_posts;
$_properties = array();
foreach ($properties->posts as $property) {
$p = new Property();
$p->setData($property);
if (!empty($args['custom'])) {
if (!empty($args['custom']['lat']) && !empty($args['custom']['lng'])) {
$distance = estetico_distance($args['custom']['lat'], $args['custom']['lng'], (double) $p->getLatitude(), (double) $p->getLongitude());
$desired_distance = estetico_get_setting('default_distance');
if (isset($args['custom']['distance'])) {
$desired_distance = $args['custom']['distance'];
}
if ($distance > $desired_distance) {
$found_posts--;
continue;
}
}
}
$_properties[] = $p;
}
wp_cache_set($key, $_properties, THEME_NAME);
}
self::$last_query_found_items_count = $found_posts;
return $_properties;
}
示例2:
$meta = $property->getMeta();
$property->increaseViewCount();
ob_start();
the_content(__('Continue reading <span class="meta-nav">→</span>', THEME_NAME));
$content = ob_get_contents();
ob_end_clean();
$gallery_content = "";
$gallery_content_regex = '/<extract>(.*?)<\\/extract>/s';
preg_match($gallery_content_regex, $content, $matches);
if (isset($matches[1])) {
$gallery_content = $matches[1];
$content = preg_replace($gallery_content_regex, '', $content, 1);
}
$show_map = false;
$lat = $property->getLatitude();
$lng = $property->getLongitude();
if (!empty($lat) && !empty($lng)) {
$show_map = true;
}
$properties_page_url = estetico_get_properties_page_url();
?>
<article id="post-<?php
the_ID();
?>
" <?php
post_class();
?>
>
<header class="entry-header">