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
// remove required mark from form | |
function remove_required_attr( $args ) { | |
foreach ( $args['sections']['job-details']['fields'] as &$field_data ) { | |
if ( 'job_application' !== $field_data['id'] ) { | |
continue; | |
} | |
$field_data['required'] = false; | |
} | |
return $args; |
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
function um_custom_disable_by_role( $disable_sending, $email, $template, $args ) { | |
$user = get_user_by( 'email', $email ); | |
if ( user_can( $user, '{necessary_role_for_disable}' ) ) { | |
$disable_sending = true; | |
} | |
return $disable_sending; | |
} | |
add_filter( 'um_disable_email_notification_sending', 'um_custom_disable_by_role', 10, 4 ); |
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
function my_custom_date_add( $data, $postarr, $unsanitized_postarr, $update ) { | |
if ( 'jb-job' === $data->post_type ) { | |
$data->post_name = wp_date( 'Y-m-d', strtotime( $data->post_date ) ) . $data->post_name; | |
} | |
return $data; | |
} | |
add_filter( 'wp_insert_post_data', 'my_custom_date_add', 10, 4 ); |
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
function jb_job_submission_form_args_custom( $args ) { | |
foreach ( $args['sections']['job-details']['fields'] as &$field ) { | |
if ( 'job_description' === $field['id'] ) { | |
$field['type'] = 'textarea'; | |
} | |
} | |
return $args; | |
} | |
add_filter( 'jb_job_submission_form_args', 'jb_job_submission_form_args_custom', 10, 1 ); |
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
function my_jb_update_user_display_name( $userdata ) { | |
$userdata['display_name'] = $userdata['first_name'] . ' ' . $userdata['last_name']; | |
return $userdata; | |
} | |
add_filter( 'jb_job_submission_create_account_data', 'my_jb_update_user_display_name', 10, 1 ); | |
add_filter( 'jb_job_submission_update_account_data', 'my_jb_update_user_display_name', 10, 1 ); |
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
remove_filter( 'um_profile_field_filter_hook__user_rating', 'um_reviews_show_rating', 99 ); | |
/** | |
* Hide rating at frontend | |
* | |
* @param $value | |
* @param $data | |
* | |
* @return string | |
*/ |
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
function um_001122_config_get( $data, $key ) { | |
if ( 'password_reset_attempts_timeout' === $key ) { | |
// Use any time in seconds. There is using WordPress constant for making timeout = 24hr. Important! Value must be not null and numeric. | |
$data = DAY_IN_SECONDS; | |
} | |
return $data; | |
} | |
add_filter( 'um_config_get', 'um_001122_config_get', 10, 2 ); |
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
function um_021522_form_notice( $text, $key ) { | |
if ( 'lostpassword-info' === $key ) { | |
$text = __( 'Please enter your email address. You will receive an email message with instructions on how to reset your password.', 'ultimate-member' ); | |
} | |
return $text; | |
} | |
add_filter( 'um_form_notice', 'um_021522_form_notice', 10, 2 ); | |
function um_021522_lostpassword_form_args( $lostpassword_args ) { |
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
/** | |
* Use real URLs instead of {user_exists_url}, {user_doesnot_exist_url} placeholders. | |
*/ | |
function um_012722_redirect_after_sending_password_reset( $user_id = null ) { | |
if ( is_numeric( $user_id ) ) { | |
// user exists | |
wp_redirect( '{user_exists_url}' ); | |
} else { | |
wp_redirect( '{user_doesnot_exist_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 | |
/** | |
* Description: Fires in the form footer before closing tag in the form. | |
* This hook may be used to display custom content in the form footer. | |
* | |
* Hook: um_form_footer | |
* | |
* Type: action | |
* @package um\core |