Skip to content

Instantly share code, notes, and snippets.

View steffendre's full-sized avatar

Steffen Dressler steffendre

View GitHub Profile
public function facetwp_show_proximity() {
$output = '';
$distance = facetwp_get_distance();
if ( false !== $distance ) {
$output .= esc_html( round( $distance, 2 ) );
}
$output .= 'hello';
return $output;
}
@steffendre
steffendre / gist:37bdf1f2d98eabe74d8fee8dc899d790
Last active May 15, 2018 09:18
PMPro Approval Addon customization (temporary gist)
/**
* Send an email to admin and membership approvers when a user has signed up for a membership level that requires approval.
*
*/
public static function pmpro_after_change_membership_level( $level_id, $user_id ){
//check if level requires approval, if not stop executing this function and don't send email.
if( !PMPro_Approvals::requiresApproval( $level_id ) ){
return;
}