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 | |
/** | |
* Shortcode that displays the profile header. | |
* Example: [um_profile_header form_id="7" user_id="1"] | |
* | |
* @global \wpdb $wpdb | |
* | |
* @param array $atts Shortcode attributes: | |
* - (int) form_id - profile form ID. The first profile form if blank. |
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 | |
if ( ! function_exists( 'um_email_locate_template' ) ) { | |
/** | |
* Locate a template and return the path for inclusion. | |
*/ | |
function um_email_locate_template( $template_name ) { | |
$blog_id = is_multisite() ? '/' . get_current_blog_id() : ''; | |
$template = locate_template( |
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 validation and error message for the "E-mail Address" field. | |
*/ | |
add_action( 'um_custom_field_validation_user_email_details', 'um_custom_validate_user_email_details', 999, 3 ); | |
function um_custom_validate_user_email_details( $key, $array, $args ) { | |
if ( $key == 'user_email' && isset( $args['user_email'] ) ) { | |
if ( isset( UM()->form()->errors['user_email'] ) ) { | |
unset( UM()->form()->errors['user_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
/** | |
* Send private message on ENTER. | |
* Add this code to your custom JS file. | |
*/ | |
jQuery( document.body ).on( 'keypress', 'textarea.um_message_text', function ( event ) { | |
if ( event.keyCode && event.keyCode === 13 || event.which === 13 ) { | |
jQuery( event.target ).closest( '.um-message-footer' ).find( '.um-message-send' ).trigger( 'click' ); | |
} | |
} ); |
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 | |
/** | |
* Hook: um_login_redirect_url | |
* | |
* Type: filter | |
* | |
* Description: Change redirect URL after successful login. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/um-actions-login.php#L258 |
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 | |
/** | |
* Hook: um_after_everything_output | |
* | |
* Type: action | |
* | |
* Description: Fires after the form shortcode is loaded. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-shortcodes.php#L819 |
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 | |
/** | |
* Hook: um_after_form | |
* | |
* Type: action | |
* | |
* Description: Fires before the closing tag in the form. | |
* May be used to display custom content in the form footer. | |
* |
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 | |
/** | |
* Hook: um_after_{$mode}_fields | |
* | |
* Type: action | |
* | |
* Description: Fires after the form fields. | |
* May be used to display custom content after form fields or add hidden fields. | |
* |