Wordpress custom MU plugin fetch user details -


I hope you can help with a custom login with a WordPress Multisity, which allows users to access the original WP-admin By default, those who do not have the right permission, this error has been given to them.

  You have tried to access the "WordPress" dashboard, but you do not have privileges on this site. If you feel that you should be able to access the "WordPress" dashboard, please contact your network administrator.   

I think they will be redirected to the primary blog like this example.

However, my custom plug-in in my Mu Plug-in does not include any of $ current_user and functions to get current user work I have no problem in other tasks Is created, so I know there is nothing wrong in including the file.

I understood it at the end I hope that it helps someone < Pre> function check_if_user_needs_redirecting () {$ active_blog = get_active_blog_for_user (get_current_user_id ()); $ Blogid = get_current_blog_id (); If ($ blogid! = $ Active_blog- & gt; blog_id) {Header ('location:' $ Active_blog- & gt; siteurl. '/ Wp-admin /'); Go out; }} Add_action ('init', 'check_if_user_needs_redirecting');

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -