• Resolved Halil

    (@halilesen)


    Hi,
    I want to make a few edits regarding registered users.

    1. I want to hide the Admin Bar from subscribers (and maybe authors).
    2. I want subscribers not to enter the admin panel (wp-admin) in any way.
    3. I want to create menu items that only authors or members can see.

    It would be better if I could do these with code and not plugins.

    There are several codes on the internet but I am not sure about some of them.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 1)hide the Admin Bar from subscribers

    add_action('set_current_user', 'cc_hide_admin_bar');
    function cc_hide_admin_bar() {
      if (!current_user_can('edit_posts')) {
        show_admin_bar(false);
      }
    }

    2) disable admin panel for subscribers

    
    add_action('admin_init', 'disable_dashboard');
    function disable_dashboard() {
        if (current_user_can('subscriber') && is_admin()) {
            wp_redirect(home_url()));
            exit;
        }
    }
    

    3) read about roles and permisions
    https://developer.ww.wp.xz.cn/plugins/users/roles-and-capabilities/

    This plugin can help you to hide menus.
    https://ww.wp.xz.cn/plugins/capability-manager-enhanced/

    Thread Starter Halil

    (@halilesen)

    Thanks.

    Please mark the topic as solved if you like.did you find the solution, you are looking for?

    Thread Starter Halil

    (@halilesen)

    I thought the membership system, or rather member synchronization, was unnecessary. And it was so complicated that I couldn’t handle it. Because it was WordPress and phpBB. I stopped syncing members. It was enough to compare the theme.

    And I already knew about the plugin your mentioned. Very helpful.

    Thank you very much for your interest.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘regarding registered users’ is closed to new replies.