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 wpum_account_tab_changes( $tabs ) { | |
$tabs['settings']['name'] = esc_html( 'User Details' ); | |
$user = wp_get_current_user(); | |
if ( in_array( 'subscriber', (array) $user->roles ) ) { | |
unset( $tabs['institution-detail'] ); | |
$tabs['individual-detail']['name'] = esc_html( 'Additional Information' ); | |
} |
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 this file to the wp-content/mu-plugins directory. The mu-plugins directory might need to be created. | |
/** | |
* Send the new user registered email to other email addresses | |
*/ | |
add_filter( 'wpum_admin_registration_confirmation_email_recipient', function ( $to_email ) { | |
return $to_email . ',someotheremail@gmail.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 | |
add_filter( 'wpum_admin_registration_confirmation_email_headers', function() { | |
return array('Content-Type: text/html; charset=UTF-8'); | |
}); | |
add_filter('wpum_admin_registration_confirmation_email_message', function( $message, $user ) { | |
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); | |
$message = sprintf( esc_html__( 'You have a new member application for the %s:', 'wp-user-manager' ), $blogname ) . "<br><br>"; |
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( 'wpum_field_ouput_callback_function', 'my_wpum_field_ouput_callback_function', 10, 3 ); | |
function my_wpum_field_ouput_callback_function( $func_name, $field, $value ) { | |
if ( $field->primary_id !== 'user_description' ) { | |
return $func_name; | |
} | |
return 'wpum_format_field_description_output'; | |
} |
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( 'wpum_before_registration_end', function () { | |
global $wpum_stop_reg_email; | |
$wpum_stop_reg_email = true; | |
} ); | |
add_action( 'wpum_email_send_before', function () { | |
global $wpum_stop_reg_email; | |
if ( empty( $wpum_stop_reg_email ) ) { |
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( 'wpum_redirect_after_login', 'my_wpum_redirect_after_login', 10, 2 ); | |
function my_wpum_redirect_after_login( $redirect, $user ) { | |
if ( $user->ID === 1 ) { | |
$redirect = home_url( '/some-url/' ); | |
} elseif ( $user->ID === 2 ) { | |
$redirect = home_url( '/another-url/' ); | |
} |
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 | |
/** | |
* @param array $file_paths | |
* | |
* @return array | |
*/ | |
function my_wpum_register_template_location( $file_paths ) { | |
$path = trailingslashit( dirname( __FILE__ ) . 'templates' ); | |
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 | |
// Save this file to the wp-content/mu-plugins directory. The mu-plugins directory will need to be created if it doesn't exist. | |
/** | |
* @param int $user_id | |
*/ | |
function wpum_store_user_id( $user_id ) { | |
global $wpum_new_user_id; | |
$wpum_new_user_id = $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 | |
ob_start(); | |
// Add your restricted template content here | |
?> | |
<p>some content</p> | |
<?php | |
get_template_part( 'sometemplate' ); | |
$output = ob_get_clean(); | |
echo wpum_restrict_logged_in( array(), $output ); |
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( 'wpum_admin_registration_confirmation_email_attachments', function ( $attachments, $user ) { | |
$field_keys = array( | |
'wpum_field_file_13', // TODO change to the custom field key(s) | |
); | |
foreach ( $field_keys as $field_key ) { | |
$file = get_user_meta( $user->ID, $field_key, true ); | |
if ( $file ) { |