Support » Plugin: Custom WP Login » non-admin won’t go to dashboard after login

  • Resolved rdtaal

    (@rdtaal)


    Hi,

    Love your plugin but, non-admin won’t go to dashboard after login.
    It goes to my account or to the frontpage not to the backend.

    I unchecked Restrict access to the dashboaord (http://www.vvmuzeescheveningen.nl/wp-admin/) from non-admins? but still not accesible directly, have to manually type the …/wp-admin and then i will work but not directly.

    Hope to hear form you,
    Kind regards, Rob

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @rdtaal,

    I’m glad you’re enjoying the plugin! To do this we’ll need to add a filter function. What roles would you like to be sent to the admin after logging in?

    Let me know.

    Cheers,
    Kevin.

    Hi Kevin,

    The role after logging in is an Editor.
    b.t.w. some text is not yet translated automatically
    see this link
    Where can i translate them?
    p.s. if you want i can translate the settings page to Dutch aswell for you.

    Kind regards,

    Rob

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hey Rob,

    We can push a plugin update in the next few days to try to improve the i18n of the plugin (i.e. making more strings available to be translated).

    To set up an editor redirect, you can use a filter function like this:

    
    add_filter( 'yikes-custom-login-login-redirect-url', 'yikes_redirect_editors_to_admin_dashboard', 10, 3 );
    
    function yikes_redirect_editors_to_admin_dashboard( $redirect_url, $request_page_id, $current_user ) {
    
    	if ( isset( $current_user->roles ) && in_array( 'editor', $current_user->roles ) ) {
    		return admin_url();
    	}
    
    	return $redirect_url;
    }

    Are you familiar with adding filter functions to your website?

    Let me know.

    Cheers,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Rob,

    I took a look at the code and the error message in your screenshot is setup as translatable. Do you not see that string when translation? How are you doing your translations?

    Let me know.

    Cheers,
    Kevin.

    Hi Kevin,

    Thanks for the filter function code, works like a charm!

    So far i was looking here to find your plugin to translate
    https://translate.wordpress.org/locale/nl/default/wp-plugins?s=Custom+WP+Login+

    Let me know if i can be of any help.

    Best Regards,
    Rob

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Rob,

    I think this is the right place for translations: https://translate.wordpress.org/projects/wp-plugins/custom-wp-login/dev/nl/default.

    Thank you,
    Kevin.

    Hi Kevin,
    Consider it done 😉
    Best Regards,
    Rob

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘non-admin won’t go to dashboard after login’ is closed to new replies.