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 / Ultimate Member 2.0 - Add Profile Photo in Register Form
Created June 2, 2019 13:15
Ultimate Member 2.0 - Add Profile Photo in Register Form
/**
* Add new predefined field "Profile Photo" in UM Form Builder.
*/
add_filter("um_predefined_fields_hook","um_predefined_fields_hook_profile_photo", 99999, 1 );
function um_predefined_fields_hook_profile_photo( $arr ){
$arr['profile_photo'] = array(
'title' => __('Profile Photo','ultimate-member'),
'metakey' => 'profile_photo',
@champsupertramp
champsupertramp / Ultimate Member - Customise profile header
Created January 22, 2019 02:56
Ultimate Member - Customise profile header
<?php
add_action("init","um_custom_init");
function um_custom_init(){
remove_action( 'um_profile_header', 'um_profile_header', 9 );
add_action( 'um_profile_header', 'um_custom_profile_header', 9 );
}
/**
* Profile header
@champsupertramp
champsupertramp / Ultimate Member Groups - Create discussion post
Last active March 19, 2019 12:06
Ultimate Member Groups - Create discussion post
function wpuf_post_umgroup( $post_id, $form_id ) {
/* Build the post content by adding the referer URL to the comment and update the post */
$lv_comment = $_POST['_my_comment'] . PHP_EOL . PHP_EOL . home_url() . wp_get_referer();
$lv_post = array();
$lv_post['ID'] = $post_id;
$lv_post['post_author'] = get_current_user_id();
$lv_post['post_content'] = $lv_comment;
@champsupertramp
champsupertramp / Ultimate Member - Permanently disable user caching
Created August 17, 2018 17:56
Ultimate Member - Permanently disable user caching
<?php
add_filter("um_get_option_filter__um_profile_object_cache_stop","__return_true");
?>
@champsupertramp
champsupertramp / Ultimate Member - WooCommerce keep default role on member role upgrade
Created July 19, 2018 13:11
Ultimate Member - WooCommerce keep default role on member role upgrade
<?php
/**
** WooCommerce keep default role on member role upgrade
**/
add_action("um_after_member_role_upgrade","um_custom_add_free_role", 10, 2 );
function um_custom_add_free_role( $role, $old_roles ){
$user_id = get_current_user_id();
$u = new WP_User( $user_id );
$u->add_role( 'free' );
@champsupertramp
champsupertramp / gist:2f4d08d2fc0e7556786fe5c2b360a344
Created June 28, 2018 04:21
Ultimate Member - Custom account design Shortcodes
General settings -
[ultimatemember_account tab="general"]
Change password -
[ultimatemember_account tab="password"]
Privacy -
[ultimatemember_account tab="privacy"]
Notifications -
@champsupertramp
champsupertramp / gist:3f9b10da7edecd2f434a850b9ef4339b
Created June 28, 2018 04:15
Ultimate Member Account Page shortcode for Delete
[ultimatemember_account tab="delete"]
@champsupertramp
champsupertramp / gist:88fc589311deab9eafbb0547af71fae7
Created June 28, 2018 04:15
Ultimate Member Account Page shortcode for Notifications
[ultimatemember_account tab="notifications"]
@champsupertramp
champsupertramp / gist:1c2b7a1f257280ed7f2d2e20aa0cca4b
Created June 28, 2018 04:14
Ultimate Member Account Page shortcode for Privacy
[ultimatemember_account tab="privacy"]
@champsupertramp
champsupertramp / gist:32eca26a93747512a2a345f0c175a1c3
Created June 28, 2018 04:14
Ultimate Member Account Page shortcode for Change password
[ultimatemember_account tab="password"]