Viewing 8 replies - 1 through 8 (of 8 total)
  • Good question. I’m wondering the same thing…

    Plugin Author P?r Thernstr?m

    (@eskapism)

    Currently it’s everyone with the edit_pages capability.

    This can be modified by using the filter simple_history_view_history_capability.

    @p?r: thanks. Is there any docs online to view how to use this filter?
    I’d like to allow only admins or superadmins (under multisite) to view reports. How do you implement this?

    Plugin Author P?r Thernstr?m

    (@eskapism)

    This should do it I think:

    // Require the manage_options-capability to be able to view the simple history log
    // manage_options = a capability that only admin have
    add_filter("simple_history_view_history_capability", function($cap) {
      return "manage_options"
    });

    Are you sure the syntax is ok? I obtain a blank page when I added that code to my functions.php file

    Plugin Author P?r Thernstr?m

    (@eskapism)

    Are you perhaps running or PHP < 5.3?
    Try this instead then:

    // Require the manage_options-capability to be able to view the simple history log
    // manage_options = a capability that only admin have
    add_filter("simple_history_view_history_capability", "prefix_simple_history_view_history_capability");
    
    function prefix_simple_history_view_history_capability($cap) {
      return "manage_options"
    }

    Buddy there is a small typo in your code. You forgot a ; after the return.

    add_filter("simple_history_view_history_capability", "prefix_simple_history_view_history_capability");
    
    function prefix_simple_history_view_history_capability($cap) {
      return "manage_options";
    }

    Now it works!
    Thank you!

    Hello.
    At home it always appears as an editor and administrator.
    How to erase it of the editor.
    Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Who Can See It?’ is closed to new replies.