Skip to content

Instantly share code, notes, and snippets.

View ahmedzeidan's full-sized avatar

Ahmed Z. ahmedzeidan

View GitHub Profile
@denisbaranov
denisbaranov / Validate the email address by domain on registration.php
Last active December 7, 2023 12:19
The following code requires @gmail.com as an email domain for user registrations. You can change @gmail.com to any provider you want. The code below requires a user email to be collected during registration.
<?php
/**
* This example shows how to validate the email address by domain on registration.
* The code below requires a user email to be collected during registration.
*
* Change the array $allowed_email_domains - add or remove what you need.
* Add this code snippet to the end of the file functions.php in the active theme directory.
*
* Ultimate Member documentation: https://docs.ultimatemember.com/
@GeoffEW
GeoffEW / remove_free.php
Created November 1, 2016 04:50
The Events Calendar - Make code empty if it's 0 or Free
<?php
/*
* The Events Calendar - Make code empty if it's 0 or Free
*/
add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 );
function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) {
if ( $cost == 0 || $cost == 'Free' ) {
$cost = '';