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 | |
add_action('um_after_new_user_register','um_auto_follow_artists',10,2); | |
function um_auto_follow_artists( $user_id, $args ){ | |
global $ultimatemember, $um_followers; | |
$follow_users = array( | |
'rjtmusic', | |
'james-peacock', | |
'carl-thomson', | |
'jonathan-proud', |
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 | |
//Last Login | |
um_fetch_user( $user_id ); | |
echo um_user("last_login"); | |
// Last Active | |
global $um_online; | |
$users = $um_online->get_users(); | |
if( isset( $users[ $user_id ] ) ){ |
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
/** | |
* Usage: | |
* [um_show_content roles='member'] <!-- insert content here --> [/um_show_content] | |
* You can add multiple target roles, just use ',' e.g. [um_show_content roles='member,candidates,pets'] | |
**/ | |
if( ! function_exists("um_shortcode_show_content_for_role") ){ | |
function um_shortcode_show_content_for_role( $atts = array() , $content = '' ) { | |
$a = shortcode_atts( array( | |
'roles' => 'member', | |
), $atts ); |
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 | |
/** | |
* Ultimate Member Notification extension - Add a custom notification | |
*/ | |
if( class_exists("UM_Notifications_API") ){ | |
global $um_notifications; | |
$um_notifications->api->store_notification( $author, 'my_custom_notification_type', $vars ); | |
add_filter("um_notifications_core_log_types","custom_um_notifications_core_log_types",10,1); | |
function um_notifications_core_log_types( $array ){ | |
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 | |
/** | |
* Ultimate Member - Custom Profile Submit | |
* You can also use 'um_user_edit_profile' when there's no validation errors | |
*/ | |
add_action("um_user_profile_extra_hook","um_custom_user_profile_extra_hook", 10, 1); | |
function um_custom_user_profile_extra_hook( $args ){ | |
// var_dump ( $args ) ; | |
} | |
?> |
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
jQuery(function(){ | |
jQuery(".um-search form *").keypress(function(e){ | |
if (e.which == 13) { | |
jQuery('.um-search form').submit(); | |
return false; | |
} | |
}); | |
}); |
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 | |
/** | |
* Add profile content for 'Pages' tab's section | |
* @param Array $args | |
* @hook Action 'um_profile_content_pages' | |
*/ | |
function um_custom_add_profile_content_pages( $args ){ | |
echo "Hello World"; | |
} | |
add_action('um_profile_content_pages','um_custom_add_profile_content_pages',10,1); |
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 | |
/*** | |
*** Custom Email Template | |
****/ | |
function um_custom_email_template(){ | |
global $ultimatemember, $user_ID; | |
um_fetch_user( $user_ID ); |
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 | |
/*** | |
*** @Get User Meta | |
***/ | |
// You can set the user id to retrieve the meta key value | |
// global $ultimatemember; | |
// $ultimatemember->user->set( $user_ID ); | |
echo um_user('first_name'); | |
// You can check some useful meta keys/values that you can | |
// retrieve with the above function here: https://codex.wordpress.org/Function_Reference/get_userdata#Notes |