Last active
September 9, 2017 17:31
-
-
Save kenmasters/1ae439d495e1721ecbb079e32b3a64b2 to your computer and use it in GitHub Desktop.
Remove `Map It` link in gravityform address field
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
// code placement: current themes functions.php | |
// code courtesy of https://techblog.willshouse.com/?p=5249 | |
// Remove `Map It` in email notification | |
add_filter('gform_pre_send_email', 'gform_pre_send_email_cb'); | |
function gform_pre_send_email_cb($email) { | |
// attempt to match the link using a regular expression | |
$test = preg_replace("#\<a [^>]+?\>Map It[^>]+\>#i", '', $email["message"]); | |
// if the result is not empty / blank, use it to replace the original html | |
if(trim($test)) | |
{ | |
$email["message"] = $test; | |
} | |
return $email; | |
} | |
// code placement: current themes style.php | |
// Remove `Map It` in {all_field} merged tag | |
.map-it-link { | |
display: none !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment