-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #25 Only call bw_googlemap_v3 when lat and long are numeric
- Loading branch information
1 parent
605d3b2
commit 7b1f0d2
Showing
1 changed file
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php // (C) Copyright Bobbing Wide 2015 | ||
<?php // (C) Copyright Bobbing Wide 2015, 2017 | ||
/** | ||
* Return the Google Map for the given _post_code, _lat and _long | ||
* | ||
* Use [bw_show_googlemap] to display a Google Map | ||
* passing the values of _post_code, _lat and _long | ||
* so it doesn't need to get them from oik options | ||
* This is similar to using [bw_show_googlemap] to display a Google Map | ||
* except we pass the values of _post_code, _lat and _long | ||
* so it doesn't need to get them from oik options. | ||
* | ||
* @param array - | ||
* @param string $post_code | ||
* @param string $lat | ||
* @param string $long | ||
* @param integer $ID | ||
* @return string - Google Map | ||
*/ | ||
function bw_fields_get_google_map( $post_code, $lat=null, $long=null, $ID=null ) { | ||
|
||
bw_trace2(); | ||
bw_backtrace(); | ||
|
||
|
||
oik_require( "shortcodes/oik-googlemap.php" ); | ||
|
||
|
||
|
||
$google_map = bw_googlemap_v3( get_the_title( $ID ) | ||
, $lat | ||
, $long | ||
, $post_code | ||
, "100%" | ||
, "400px" | ||
); | ||
|
||
//bw_trace2(); | ||
//bw_backtrace(); | ||
|
||
if ( is_numeric( $lat ) && is_numeric( $long ) ) { | ||
oik_require( "shortcodes/oik-googlemap.php" ); | ||
$google_map = bw_googlemap_v3( get_the_title( $ID ) | ||
, $lat | ||
, $long | ||
, $post_code | ||
, "100%" | ||
, "400px" | ||
); | ||
} else { | ||
$google_map = null; | ||
} | ||
|
||
return( $google_map ); | ||
return( $google_map ); | ||
} |