Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View champsupertramp's full-sized avatar
🏕️
Working from home

Champ Camba champsupertramp

🏕️
Working from home
View GitHub Profile
@champsupertramp
champsupertramp / gist:d3e252763eb0adf9fe7b
Last active November 13, 2017 17:53 — forked from vxnick/gist:380904
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@champsupertramp
champsupertramp / currency_list
Last active January 27, 2024 01:35 — forked from MindaugasR/currency_list
World Currency list in PHP Array
array (
'ALL' => 'Albania Lek',
'AFN' => 'Afghanistan Afghani',
'ARS' => 'Argentina Peso',
'AWG' => 'Aruba Guilder',
'AUD' => 'Australia Dollar',
'AZN' => 'Azerbaijan New Manat',
'BSD' => 'Bahamas Dollar',
'BBD' => 'Barbados Dollar',
'BDT' => 'Bangladeshi taka',
@champsupertramp
champsupertramp / currency_symbols.php
Last active August 31, 2015 18:11 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@champsupertramp
champsupertramp / gist:e412635fee8701c759f7
Created November 9, 2015 07:04
Ultimate Member: Social Login – Redirecting to homepage, and not logging in or registering or CSRF tokens/state mismatch
/**
*** If you're using a custom WordPress theme, one of the possible causes of the issue is ' Post Relational Links ' added in the Header
*** ( https://developer.wordpress.org/reference/functions/adjacent_posts_rel_link/ )
** This feature loads pages in the background process and it causes the register page to load multiple times.
** It reloads the Social Tokens again and causes mismatch session keys during authentication
**
**/
remove_action('wp_head', 'start_post_rel_link', 10, 0 );
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
<?php
/***
*** @Dettach um default avatar
***/
add_filter('avatar_defaults', 'um_avatar_defaults', 99999 );
function um_avatar_defaults($avatar_defaults) {
remove_filter('get_avatar', 'um_get_avatar', 99999, 5);
return $avatar_defaults;
}
<?php
/**
* @um_user_after_updating_profile
*/
function doggycom_redirect_after_updating_profile( $to_update ){
exit( wp_redirect( remove_query_arg( array('profiletab','um_action') ) ) );
}
add_action('um_user_after_updating_profile','doggycom_redirect_after_updating_profile',10,1);
?>
/**
* @detach action 'um_remove_unused_uploads'
*/
function detach_um_remove_unused_uploads( $arg ){
remove_action('um_after_user_upload','um_remove_unused_uploads', 10 );
}
add_action('um_after_user_updated','detach_um_remove_unused_uploads',10,1);
<?php
/***
*** @Do not apply to backend default avatars
***/
add_filter('avatar_defaults', 'um_avatar_defaults', 99999 );
function um_avatar_defaults($avatar_defaults) {
remove_filter('get_avatar', 'um_get_avatar', 99999, 5);
return $avatar_defaults;
}
?>
<?php
/***
*** @Get user avatar uri
***/
// Call ultimatemember global variable
global $ultimatemember;
$user_id = 1;
// Set user ID
<?php
/**
* Custom sanitization of fields
*/
add_filter('um_profile_field_filter_hook__','my_custom_sanitize_fields', 99, 2 );
function my_custom_sanitize_fields( $value, $data ){
// Add tags to mail value
if ( !is_array( $value ) ) {