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_registration_redirect( $user_id ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'fi' ) { | |
$redirect_url = 'redirect_url1'; | |
} else { | |
$redirect_url = 'redirect_url2'; |
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
add_action( 'um_member_directory_before_query', 'my_custom_um_remove_googlemap' ); | |
function my_custom_um_remove_googlemap() { | |
if ( ! empty( $_POST['directory_id'] ) ) { | |
$directory_id = UM()->member_directory()->get_directory_by_hash( $_POST['directory_id'] ); | |
if ( $directory_id == '{your directory ID here}' ) { | |
remove_filter( 'um_profile_field_filter_hook__googlemap', 'um_profile_field_filter_hook__googlemap', 99 ); | |
} | |
} |
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
//to make this ability possible for all registration forms on your website | |
add_filter( 'um_registration_for_loggedin_users', '__return_true' ); | |
//to make this ability possible only for {selected registration form ID here} | |
function my_custom_um_registration_for_loggedin_users( $activate, $args ) { | |
if ( $args['form_id'] == '{selected registration form ID here}' ) { | |
$activate = true; | |
} | |
return $activate; | |
} |
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_fields_array_for_titles( $fields, $key ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'zh-hant' ) { | |
switch ( $key ) { | |
case 'coach-mentoring_specialties': | |
$fields[ $key ]['label'] = '導師(Coach-Mentoring)特長'; |
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_field_view_wpml( $res, $data, $type ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'zh-hant' ) { | |
switch ( $data['metakey'] ) { | |
case 'gender': | |
$res = $res == 'Female' ? '女' : '男'; |
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
// Important: you need to get the job data from the custom post meta where you save them | |
// there aren't salary types and amount metakey for the job by default | |
// location address can be extended only when GoogleMapsAPI is active in the plugin settings | |
// extend location | |
add_filter( 'jb-job-structured-data', 'jb_job_structured_data_extend_location', 10, 2 ); | |
function jb_job_structured_data_extend_location( $data, $job ){ | |
if ( $job->ID == {jobID here} ) { | |
$data['jobLocation']['address'] = array( |
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
$data = [ | |
'af' => 'af_ZA', | |
'ar' => 'ar', | |
'az' => 'az', | |
'be' => 'be_BY', | |
'bg' => 'bg_BG', | |
'bn' => 'bn_BD', | |
'bs' => 'bs_BA', | |
'ca' => 'ca', | |
'cs' => 'cs_CZ', |
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_templates_path( $path, $template_name, $module ) { | |
$uploads_dir = wp_get_upload_dir(); | |
return $uploads_dir['basedir']; | |
} | |
add_filter( 'um_template_structure_custom_path', 'um_custom_templates_path', 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
'en' => [ //line 82 | |
'internal_code' => 'en', | |
'english' => 'English', | |
'local' => 'English', | |
'rtl' => false, | |
'wp_locale' => 'en_US', | |
], | |
'ru' => [ //line 340 | |
'internal_code' => 'ru', |
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
// run this function only once for bulk uncheck `Hide from queries` option for restricted pages, posts | |
function um_update_post_restrictions() { | |
global $wpdb; | |
$posts = $wpdb->get_results("SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = 'um_content_restriction'", ARRAY_A ); | |
foreach ( $posts as $post ) { | |
$meta_value = maybe_unserialize( $post['meta_value'] ); | |
$meta_value['_um_access_hide_from_queries'] = false; | |
update_post_meta( $post['post_id'], 'um_content_restriction', $meta_value ); | |
} |