Support » Plugin: Simple History » Restrict history view by role

  • Resolved saowp

    (@saowp)


    Hullo, very nice plugin! How can I restrict the viewing of the History to Administrator role? Presently it is viewable by any role.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pär Thernström

    (@eskapism)

    There is a filter available to modify this: simple_history/view_history_capability.

    It can be used liked this (example from the examples file):

    
    /**
     * Change capability required to view main simple history page.
     * Default capability is "edit_pages". Change to for example "manage options"
     * to only allow admins to view the history log.
     */
    add_filter('simple_history/view_history_capability', function ($capability) {
        $capability = 'manage_options';
        return $capability;
    });
    

    Thanks @eskapism , that worked!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.