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
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 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
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 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
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 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
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 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
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 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
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 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
// 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 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
function um_custom_can_view_profile( $can_view, $user_id ) { | |
if ( ! is_user_logged_in() ) { | |
if ( user_can( $user_id, 'um_volunteer' ) ) { | |
$can_view = false; | |
} | |
} else { | |
if ( current_user_can( 'um_volunteer' ) && user_can( $user_id, 'um_volunteer' ) ) { | |
$can_view = false; | |
} | |
} |
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
// Replace the function in ultimate-member/includes/core/class-rewrite.php | |
/** | |
* Locate/display a profile. | |
*/ | |
public function locate_user_profile() { | |
$permalink_base = UM()->options()->get( 'permalink_base' ); | |
if ( 'custom_meta' === $permalink_base ) { | |
$custom_meta = UM()->options()->get( 'permalink_base_custom_meta' ); | |
if ( empty( $custom_meta ) ) { |
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
// Generate slug in format: {First Name}-{First letter of Last Name}~{hash} | |
function um_custom_generate_custom_slug( $user_obj ) { | |
return strtolower( $user_obj->first_name . '-' . substr( $user_obj->last_name, 0, 1 ) . '~' . substr( strrev( md5( uniqid( 'um_user_hash' . $user_obj->ID, true ) . $user_obj->ID ) ), 0, 5 ) ); | |
} | |
function um_update_custom_usermetaaa( $user_id ) { | |
$permalink_base = UM()->options()->get( 'permalink_base' ); | |
if ( 'custom_meta' === $permalink_base ) { | |
$custom_meta = UM()->options()->get( 'permalink_base_custom_meta' ); |