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_profile_menu', 'um_profile_content_posts_custom_cat'); | |
function um_profile_content_posts_custom_cat(){ | |
$active_tab = UM()->profile()->active_tab(); | |
if ($active_tab == 'posts') { |
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 - Make all UM User Profile Private by Default. | |
* URL: https://wordpress.org/plugins/ultimate-member/ | |
*/ | |
add_filter( 'get_user_metadata', function( $profile_privacy, $object_id, $meta_key ) { | |
if( $meta_key === 'profile_privacy' ) { | |
$profile_privacy = 'Only me'; | |
} | |
return $profile_privacy; |
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 - Restrict registration based on email domain. | |
* URL: https://wordpress.org/support/topic/email-domain-restriction-at-registration/ | |
*/ | |
add_action( 'um_submit_form_errors_hook__registration', 'um_register_email_provider_restrict', 99 ); | |
function um_register_email_provider_restrict( $args ) { | |
// List the email providers you want to allow | |
$allowed_domains = array('@gmail.com', '@hey.com'); |
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 | |
/** | |
* Display custom field image url in Member Directory | |
* URL: https://wordpress.org/support/topic/get-uloaded-image-url/ | |
*/ | |
add_action( 'um_members_just_after_name', 'custom_function_tester_dir' ); | |
function custom_function_tester_dir(){ | |
// Get the filename | |
$image_filename = um_user( 'national_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 | |
/* | |
* title & label Gender to Gender Identity | |
* see: https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-builtin.php#L832 | |
* | |
* @param 'title', 'metakey', 'type', 'label', 'required', 'public', 'editable', 'options' | |
* | |
* @return array | |
*/ | |
add_filter( 'um_core_fields_hook', 'um_custom_modify_text', 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 | |
add_filter( 'manage_users_columns', 'um_custom_add_new_user_column' ); | |
function um_custom_add_new_user_column( $columns ) { | |
$columns['um_country'] = 'Country'; | |
return $columns; | |
} | |
add_filter( 'manage_users_custom_column', 'um_custom_add_new_user_column_content', 10, 3 ); | |
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( 'wp_enqueue_scripts', 'um_remove_old_css', UM()->enqueue()->get_priority() + 1 ); | |
if ( ! function_exists( 'um_remove_old_css' ) ) { | |
function um_remove_old_css() { | |
wp_dequeue_style( 'um_default_css' ); | |
wp_dequeue_style( 'um_old_css' ); | |
} | |
} |
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('tutor_student/before/wrap', 'display_tutor_msg' ); | |
function display_tutor_msg(){ | |
$user_name = sanitize_text_field(get_query_var('tutor_student_username')); | |
$sub_page = sanitize_text_field(get_query_var('profile_sub_page')); | |
$get_user = tutor_utils()->get_user_by_login($user_name); | |
$user_id = $get_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 | |
add_action( 'init', 'hide_secure_wp_admin' ); | |
function hide_secure_wp_admin() { | |
if ( is_admin() || $GLOBALS['pagenow'] === 'wp-login.php' ) { | |
// Non logged in users. | |
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) { | |
wp_redirect( um_get_core_page('login') ); | |
} | |
} |
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
{{{user.data_field}}} | |
// eg: {{{user.country}}} |