Skip to content

Instantly share code, notes, and snippets.

Andrew Adcock andrewadcock

Block or report user

Report or block andrewadcock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View establishments.module
/**
* Implements hook_webform_submission_presave().
*
* If changes to establishments are made during AAP, save them to node before
* form is complete
*
* @param WebformSubmissionInterface $webform_submission
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
@andrewadcock
andrewadcock / simple-clean-phone.php
Last active Jul 4, 2016
Simple Clean Phone Output
View simple-clean-phone.php
/*
* Pass in the phone number in it's natural state, return the numeric only version or pass 'true' as the second parameter and get ther anchor tag as well
*/
function aad_clean_phone( $number_to_clean, $return_type = false ) {
// Simple regex removes any non-numeric characters
$clean = preg_replace( '/\D/', "", $number_to_clean );
// Return full anchor tag is $return_type is true, else just return the stripped phone number
You can’t perform that action at this time.