| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/public_html/old-website/wp-content/plugins/jetpack/modules/ |
Upload File : |
<?php
require_once dirname( __FILE__ ) . '/geo-location/class.jetpack-geo-location.php';
/**
* Geo-location shortcode for display of location data associated with a post.
*
* Usage with current global $post:
* [geo-location]
*
* Usage with specific post ID:
* [geo-location post=5]
*/
add_shortcode( 'geo-location', 'jetpack_geo_shortcode' );
function jetpack_geo_shortcode( $attributes ) {
$attributes = shortcode_atts( array( 'post' => null, 'id' => null ), $attributes );
return jetpack_geo_get_location( $attributes['post'] ? $attributes['post'] : $attributes['id'] );
}
/**
* Get the geo-location data associated with the supplied post ID, if it's available
* and marked as being available for public display. The returned array will contain
* "latitude", "longitude" and "label" keys.
*
* If you do not supply a value for $post_id, the global $post will be used, if
* available.
*
* @param integer|null $post_id
*
* @return array|null
*/
function jetpack_geo_get_data( $post_id = null) {
$geo = Jetpack_Geo_Location::init();
if ( ! $post_id ) {
$post_id = $geo->get_post_id();
}
$meta_values = $geo->get_meta_values( $post_id );
if ( ! $meta_values['is_public'] || ! $meta_values['is_populated'] ) {
return null;
}
return array(
'latitude' => $meta_values['latitude'],
'longitude' => $meta_values['longitude'],
'label' => $meta_values['label']
);
}
/**
* Display the label HTML for the geo-location information associated with the supplied
* post ID.
*
* If you do not supply a value for $post_id, the global $post will be used, if
* available.
*
* @param integer|null $post_id
*
* @return void
*/
function jetpack_geo_display_location( $post_id = null ) {
echo jetpack_geo_get_location( $post_id );
}
/**
* Return the label HTML for the geo-location information associated with the supplied
* post ID.
*
* If you do not supply a value for $post_id, the global $post will be used, if
* available.
*
* @param integer|null $post_id
*
* @return string
*/
function jetpack_geo_get_location( $post_id = null ) {
return Jetpack_Geo_Location::init()->get_location_label( $post_id );
}