Ver. 2.1.3 – Something has changed
-
Hi nsinelnikov,
I had written this function for Deny access to the requested profile page if a certain metakey value of required user not equal to the current user’s display name.
It worked perfectly up to version 2.1.2,
In version 2.1.3 something has changed and no longer works properly.
Can you suggest any changes?add_action("template_redirect","um_custom_page_restriction", 9999 ); function um_custom_page_restriction(){ $user_id = wp_get_current_user(); $display_name = $user_id->display_name; $profile_id = um_get_requested_user(); um_fetch_user( $profile_id ); $meta_value = get_user_meta( $profile_id, 'mymetakey', true ); if ( ! empty( $meta_value ) && is_user_logged_in() ) { if (ICL_LANGUAGE_CODE == 'en') { if ( um_is_core_page('user') && $display_name != $meta_value ) { exit( wp_redirect( 'https://mysite/mypage-en' ) ); } } if (ICL_LANGUAGE_CODE == 'de') { if ( um_is_core_page('user') && $display_name != $meta_value ) { exit( wp_redirect( 'https://mysite//mygage-de' ) ); } } } }
Thnaks in advance
Lion
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Ver. 2.1.3 – Something has changed’ is closed to new replies.