WordPress.org

Support

Support » Multisite » wp-admin/user-new.php – promote_user capability ?

wp-admin/user-new.php – promote_user capability ?

  • Hello world,

    After looking on wp-admin/user-new.php, I’m finding that there is a check for ‘promote_user’ (without final “s”) capability on line 60.
    if ( ! current_user_can('promote_user', $user_details->ID) )

    Is this capability is an error (plural ending forgotten) or is it wanted ?
    I make the modification on my installation and it works better for me…

    Sorry for my English and thanks for your future answers,
    Thibaut.

    PS: the only one mention of promote_user that I found is on this ticket

Viewing 1 replies (of 1 total)
  • David Sader
    Participant

    @dsader

    ‘promote_users’ is a capability the current user may have while logged in.
    ‘promote_user’ is a more specific capability in the context of the user_id the current user is promoting.

    There are several other capabilities that have the same plural or not plural contexts.

    Look at the ‘case ‘promote_user’:’ instance in function map_meta_cap in capabilities.php.

    In the context of what you have pasted above, it looks fine – not a typo.

    You say it “works better” with the edits you have made, but what is it you are trying to do? There may be a way to do what you intend without edits to core files.

    I doubt your edits to the core files solves an existing typo error, instead you may have created more headaches by editing a core file.

Viewing 1 replies (of 1 total)
  • The topic ‘wp-admin/user-new.php – promote_user capability ?’ is closed to new replies.