http://stackoverflow.com/questions/7549669/php-validate-latitude-longitude-strings-in-decimal-format
*/
if (!preg_match("/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/", $agm_options['map_Lat']))
{
echo "
Nothing saved, Invalid Latitude Value.
";
}
elseif (!preg_match("/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/", $agm_options['map_Lng']))
{
echo "Nothing saved, Invalid Longitude Value.
";
}
elseif (strlen($agm_options['info_text']) <= 1000) {
/* Save posted data back to database */
update_option('ank_google_map', $agm_options);
echo "Your settings has been saved. You can always use [ank_google_map] shortcode.
";
} else {
echo "Nothing saved, Info Window Text should not exceed 1000 characters . Current Length is: " . strlen($agm_options['info_text']) . "
";
}
/*
* Detect if cache is enabled and warn user to flush cache
*/
if(WP_CACHE){
echo "It seems that a caching/performance plugin is active on this site. Please manually invalidate/flush that plugin cache to reflect any settings you saved here.
";
}
}
/*
*
* Display notice if current wp installation does not support color picker
*/
if(version_compare($GLOBALS['wp_version'],'3.5','<')){
echo "Color Picker won't work here. Please upgrade your WordPress to latest (v3.5+).
";
}
?>