WordPress.org

Support

Support » Plugins and Hacks » Members » [Plugin: Members] Checking for Capabilities

[Plugin: Members] Checking for Capabilities

  • I was reading through the documentation and I don’t understand this bit:
    “In WordPress, you can use the current_user_can() function to check if the current user has a particular capability. Since you don’t know whether a user has this plugin installed, you might want to check first.”

    What do you mean with user having the plugin installed? The plugin is installed on the server with the other wordpress files. Could somebody explain this to me?

    http://wordpress.org/extend/plugins/members/

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    @esmi

    Forum Moderator

    You can use current_user_can() to check whether a given user can access any or all of a plugin’s settings in the WP dashboard.

    I get that, but the guide also mentions something like this:

    if ( function_exists( 'members_check_for_cap' ) && members_check_for_cap( 'some_cap' ) ) {
    	/* Do something if any role has the 'some_cap' capability. */
    else {
    	/* Do something for people without the plugin. */
    }

    And I don’t understand why should the user have the plugin installed, it doesn’t make sense.

    Is it like in case I remove the plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Members] Checking for Capabilities’ is closed to new replies.
Skip to toolbar