WordPress.org

Ready to get started?Download WordPress

Forums

wp-admin/user-new.php - promote_user capability ? (2 posts)

  1. tibodut
    Member
    Posted 1 year ago #

    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

  2. David Sader
    Member
    Posted 1 year ago #

    '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.

Topic Closed

This topic has been closed to new replies.

About this Topic