resolve some errors in php logic, like strlen with str containing space that is interpreted as array instead of string
This commit is contained in:
27
plug/map_prof/srcs/map_posts/mp_post_events_pages.php
Normal file
27
plug/map_prof/srcs/map_posts/mp_post_events_pages.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
function is_event_post() {
|
||||
if ( is_admin() )
|
||||
return false;
|
||||
if ( get_post_type() != "post" )
|
||||
return 0;
|
||||
if ( get_post_status() != "publish" )
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
function mp_post_event_pages_setting() {
|
||||
global $mp_zoom;
|
||||
global $mp_zoom_set;
|
||||
global $mp_coordinates_default;
|
||||
if (is_event_post()) {
|
||||
$mp_zoom = $mp_zoom_set[1];
|
||||
|
||||
$location = get_field("location");
|
||||
$coordinates = $location->coordinates;
|
||||
|
||||
$mp_coordinates_default = $coordinates;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user