Make WordPress Core


Ignore:
Timestamp:
07/23/2020 12:50:57 AM (4 years ago)
Author:
johnbillion
Message:

Docs: Various formatting improvements to inline docblocks.

See #49572

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-role.php

    r46596 r48574  
    2626     *
    2727     * @since 2.0.0
    28      * @var array
     28     * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values
     29     *             represent whether the role has that capability.
    2930     */
    3031    public $capabilities;
     
    3334     * Constructor - Set up object properties.
    3435     *
    35      * The list of capabilities, must have the key as the name of the capability
     36     * The list of capabilities must have the key as the name of the capability
    3637     * and the value a boolean of whether it is granted to the role.
    3738     *
     
    3940     *
    4041     * @param string $role         Role name.
    41      * @param bool[] $capabilities List of capabilities keyed by the capability name,
    42      *                             e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
     42     * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values
     43     *                             represent whether the role has that capability.
    4344     */
    4445    public function __construct( $role, $capabilities ) {
     
    5253     * @since 2.0.0
    5354     *
    54      * @param string $cap Capability name.
    55      * @param bool $grant Whether role has capability privilege.
     55     * @param string $cap   Capability name.
     56     * @param bool   $grant Whether role has capability privilege.
    5657     */
    5758    public function add_cap( $cap, $grant = true ) {
     
    6263    /**
    6364     * Removes a capability from a role.
    64      *
    65      * This is a container for WP_Roles::remove_cap() to remove the
    66      * capability from the role. That is to say, that WP_Roles::remove_cap()
    67      * implements the functionality, but it also makes sense to use this class,
    68      * because you don't need to enter the role name.
    6965     *
    7066     * @since 2.0.0
     
    8076     * Determines whether the role has the given capability.
    8177     *
    82      * The capabilities is passed through the {@see 'role_has_cap'} filter.
    83      * The first parameter for the hook is the list of capabilities the class
    84      * has assigned. The second parameter is the capability name to look for.
    85      * The third and final parameter for the hook is the role name.
    86      *
    8778     * @since 2.0.0
    8879     *
    8980     * @param string $cap Capability name.
    90      * @return bool True if the role has the given capability. False otherwise.
     81     * @return bool Whether the role has the given capability.
    9182     */
    9283    public function has_cap( $cap ) {
     
    9687         * @since 2.0.0
    9788         *
    98          * @param bool[] $capabilities Associative array of capabilities for the role.
     89         * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values
     90         *                             represent whether the role has that capability.
    9991         * @param string $cap          Capability name.
    10092         * @param string $name         Role name.
Note: See TracChangeset for help on using the changeset viewer.