Forum Replies Created
-
Wow! Thanks for the great customer service! This is exactly what I need. I appreciate the extra effort helping me on this.
in reply to: Disable RedirectsGreat, I’ve went ahead and added that, updated all the settings. It’s still not working.
I still have the form redirect setup the same as the image above, and when I login using the demo role it tries to redirect me to the orginal link. Not the one in the functions file.
If I change the settings to refresh page upon login instead of URL it refreshes the page and brings the user back to the login page.
—-
add_filter('dhe_form_ajax_json_echo', function ($result, $submission ){ if( is_user_logged_in() && $submission->get_form_id() == '14022' /* Login form ID*/ ) { $user = wp_get_current_user(); $roles = ( array ) $user->roles; if(in_array('administrator', $roles)){ $result['redirect'] = 'https://www.learningsnippets.ca/wp-admin/'; //get_permalink('enter_post_id'); }elseif (in_array('um_demo', $roles)){ $result['redirect'] = 'https://www.learningsnippets.ca/demo/'; //get_permalink('enter_post_id'); } } return $result; },10,2);
in reply to: Disable RedirectsThis reply has been marked as private.in reply to: Disable Redirects
Viewing 3 posts - 1 through 3 (of 3 total)