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 | |
| /** | |
| * Hook: um_after_email_notification_sending | |
| * | |
| * Type: action | |
| * | |
| * Description: Fires after sending an email notification. | |
| * | |
| * @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-mail.php#L456 |
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 custom grouped filters to the member directory. | |
| * | |
| * Add filters you need to this array. Every filter is an array where: | |
| * - key Filter key. Any valid string key. | |
| * - type Filter type. Accepts: 'text', 'select'. | |
| * - label Filter label (used as the filter placeholder). | |
| * - fields An array of usermeta keys. Filter searches a value in these usermeta. |
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 | |
| /** | |
| * Disable email notifications for specific roles. | |
| * | |
| * @param bool $disabled Does an email is disabled? Default: false. | |
| * @param string $email Email address for sending. | |
| * @param string $template Email template. | |
| * @param array $args Arguments for sending email. | |
| * @return bool Return true to stop mailing. |
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 | |
| // Use direct links for images in the social activity wall. | |
| function um_activity_get_download_link_direct( $url, $post_id, $author_id ) { | |
| $photo = get_post_meta( $post_id, '_photo', true ); | |
| return home_url( "/wp-content/uploads/ultimatemember/{$author_id}/{$photo}" ); | |
| } | |
| add_filter( 'um_activity_get_download_link', 'um_activity_get_download_link_direct', 10, 3 ); |
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 | |
| // Enqueue the "select2" script earlier to avoid a conflict with "selectWoo". | |
| add_action( 'admin_enqueue_scripts', 'um_fix_selectWoo_conflict' ); | |
| add_action( 'wp_enqueue_scripts', 'um_fix_selectWoo_conflict' ); | |
| function um_fix_selectWoo_conflict() { | |
| if ( wp_script_is( 'select2' ) && wp_script_is( 'selectWoo' ) ) { | |
| $wp_scripts = wp_scripts(); | |
| if ( ! in_array( 'select2', $wp_scripts->queue, true ) && isset( $wp_scripts->registered[ 'select2' ] ) ) { | |
| array_unshift( $wp_scripts->queue, 'select2' ); |
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 | |
| // Redirect users to a different URL the first time they log in. | |
| add_action( 'um_on_login_before_redirect', 'my_on_login_before_redirect', 9, 1 ); | |
| function my_on_login_before_redirect( $user_id ) { | |
| $first_login = get_user_meta( $user_id, '_um_first_login', true ); | |
| if ( empty( $first_login ) ) { | |
| update_user_meta( $user_id, '_um_first_login', current_time( 'mysql', true ) ); | |
| // Set a custom redirect URL for the first time login here. |
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 | |
| // Save the page URL on registration. | |
| add_action( 'um_registration_set_extra_data', 'um_registration_set_extra_data_custom', 10, 3 ); | |
| function um_registration_set_extra_data_custom( $user_id, $args, $form_data ) { | |
| if ( isset( $_SERVER['HTTP_REFERER'] ) ) { | |
| $url = esc_url( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); | |
| update_user_meta( $user_id, 'um_registration_page_url', $url ); | |
| } elseif ( isset( $_SERVER['REQUEST_URI'] ) ) { | |
| $url = esc_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ); |
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 | |
| // Send the "New User Notification" email when profile is updated. | |
| add_action( 'um_user_after_updating_profile', function( $to_update, $user_id, $args ) { | |
| $GLOBALS['um_temp_submitted'] = isset( $args['submitted'] ) ? $args['submitted'] : $args; | |
| function um_user_after_updating_profile_submitted( $value ) { | |
| return $GLOBALS['um_temp_submitted']; | |
| } | |
| function um_user_after_updating_profile_timestamp( $value ) { |