Last active
September 3, 2015 13:43
-
-
Save CatEntangler/a8ee236e7fde8d90d193 to your computer and use it in GitHub Desktop.
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
<?php | |
function is_paying_customer( $user_id ) { | |
$paying_customer = get_user_meta( $user_id, 'paying_customer', TRUE ); | |
if( ! $paying_customer ) { | |
return false; | |
} | |
else { | |
return true; | |
} | |
} | |
add_filter( 'user_contactmethods', 'add_my_field' ); | |
function add_my_field( $profile_fields ) { | |
$user_id = ''; // Do your code to figure out what user_id you are talking about | |
if( is_paying_customer( $user_id ) ) { | |
$profile_fields[ 'my_new_field'] = 'My Field'; | |
update_user_meta( $user_id, 'my_new_field', 'my value' ); | |
} | |
return $profile_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment