• Resolved pole915

    (@pole915)


    I have a website, there are 2 admin users, equivalent of access

    admin 1

    admin 2 (being master admin that apply hide plugins and hide some plugins)

    When admin 1 deletes admin 2 , all the plugins show up with Hide plugins. Is there anyway to improve this?

    https://ww.wp.xz.cn/plugins/hide-plugins/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Brian

    (@brianmiyaji)

    @pole915 Thanks for your question! Believe it or not, this is intentional 🙂

    By default, plugins will only be hidden if:

    1. Someone other than the logged-in user has activated Hide Plugins, and
    2. That other user still exists.

    The reason for this is that without this 2nd verification, a hidden plugin could be hidden forever when the original user is deleted.

    Now, I’d advise against it but if you must, there’s a line you can alter in the code to change this behavior. See line 113:

    if ( ! isset( $user ) || ! get_userdata( $user ) || ! isset( $current_user ) ) return $plugins;

    If you change this to:

    if ( ! isset( $user ) || ! isset( $current_user ) ) return $plugins;

    You won’t see the plugins hidden by the original user even after that user has been deleted. Again, beware as this prevents any user from activating or deactivating that plugin ever again.

    Thread Starter pole915

    (@pole915)

    Great , thanks.

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

The topic ‘Admin being deleted’ is closed to new replies.