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 | |
/** | |
* Restrict registration for under 18 years old. | |
* | |
* @param array $args Form Arguments. | |
*/ | |
function um_custom_validate_birth_date( $args ) { | |
if ( ! empty( $args['birth_date'] ) ) { | |
// Birth date as a Unix timestamp. |
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 | |
/** | |
* Allow to upload vCard files via the "File Upload" field type. | |
* Add this code to the file functions.php in the active theme directory. | |
*/ | |
function um_add_vcard_file_types( $allowed_types ) { | |
if( is_array( $allowed_types ) ) { | |
$vcard_types = array( |
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 | |
/** | |
* Hide unapproved members in the members directory for everybody. | |
*/ | |
add_action( 'um_member_directory_before_query', function() { | |
add_filter( 'um_user_permissions_filter', 'custom_disable_permission_can_edit_everyone' ); | |
} ); | |
function custom_disable_permission_can_edit_everyone( $permissions ) { | |
$permissions['can_edit_everyone'] = false; |
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 | |
/** | |
* Customize registration error message. | |
*/ | |
add_action( 'um_submit_form_errors_hook', function( $args ) { | |
if ( isset( $args['mode'] ) && 'register' === $args['mode'] ) { | |
if ( isset( $args['user_email'] ) && email_exists( $args['user_email'] ) ) { | |
UM()->form()->add_error( 'user_email', __( 'There is already an account with that email', 'ultimate-member' ) ); | |
} |
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_form_button_one | |
* | |
* Type: filter | |
* | |
* Description: Change the Login Form primary button text. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/um-actions-login.php#L358 |
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_core_form_meta_all | |
* | |
* Type: filter | |
* | |
* Description: Extend UM forms meta keys. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/class-config.php#L230 |
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_admin_custom_login_metaboxes | |
* | |
* Type: action | |
* | |
* Description: Add custom metaboxes for the Login Form type. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/admin/core/class-admin-metabox.php#L1040 |
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_render_field_type_{$type} | |
* | |
* Type: filter | |
* | |
* Description: Change admin form field layout by $type. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/admin/core/class-admin-forms.php#L312 |
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_admin_pre_save_field_to_form | |
* | |
* Type: filter | |
* | |
* Description: Change field data before save to form. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/admin/core/class-admin-builder.php#L725 |
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_before_{$mode}_form_is_loaded | |
* | |
* Type: action | |
* | |
* Description: Fires before the form shortcode is loaded. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-shortcodes.php#L792 |