This file contains hidden or 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( 'wpum_get_option_members_can_view_profiles', 'my_wpum_get_option_members_can_view_profiles' ); | |
function my_wpum_get_option_members_can_view_profiles( $value ) { | |
if ( ! is_user_logged_in() ) { | |
return $value; | |
} | |
if ( ! current_user_can( 'manage_options' ) ) { | |
return $value; |
This file contains hidden or 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( 'template_redirect', 'wpum_logged_in_login_redirect' ); | |
function wpum_logged_in_login_redirect() { | |
if ( ! is_user_logged_in() ) { | |
return; | |
} | |
if ( is_page( wpum_get_core_page_id( 'login' ) ) || is_page( wpum_get_core_page_id( 'register' ) ) ) { | |
wp_redirect( get_permalink( wpum_get_core_page_id( 'account' ) ) ); |
This file contains hidden or 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 my_wpum_get_directory_user_templates( $directories ) { | |
$directories['custom'] = 'Custom User Template'; | |
return $directories; | |
} | |
add_filter( 'wpum_get_directory_user_templates', 'my_wpum_get_directory_user_templates' ); |
This file contains hidden or 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 my_wpum_get_account_fields( $fields ) { | |
if ( isset( $fields['user_displayname']['options']['display_nickname'] ) ) { | |
unset( $fields['user_displayname']['options']['display_nickname'] ); | |
} | |
return $fields; | |
} |
This file contains hidden or 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 | |
/** | |
* The Template for displaying the profile cover. | |
*/ | |
// Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) exit; |
This file contains hidden or 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 wpum_account_add_external_link( $tabs ) { | |
$tabs['external'] = array( | |
'name' => 'My External Link', | |
'priority' => 100, | |
); | |
$tabs['another-external'] = array( | |
'name' => 'Another External Link', |
This file contains hidden or 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 my_wpum_get_comments_for_profile( $args ) { | |
$args['number'] = 100; | |
return $args; | |
} | |
add_filter( 'wpum_get_comments_for_profile', 'my_wpum_get_comments_for_profile' ); |
This file contains hidden or 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( 'wpum_redirect_after_login', function( $redirect, $user ) { | |
if ( in_array( 'author', (array) $user->roles ) ) { | |
return home_url( '/author-page' ); | |
} | |
if ( in_array( 'subscriber', (array) $user->roles ) ) { | |
return home_url( '/subscriber-page' ); | |
} |
This file contains hidden or 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 my_wpum_profile_settings_title( $tabs ) { | |
$tabs['account']['name'] = 'My Custom Settings Header'; | |
return $tabs; | |
} | |
add_filter( 'wpum_account_tabs', 'my_wpum_profile_settings_title' ); |
OlderNewer