Make WordPress Core

Changeset 24491


Ignore:
Timestamp:
06/21/2013 01:01:55 PM (13 years ago)
Author:
SergeyBiryukov
Message:

Correct return value for get_role() and WP_Roles::get_role(). props tivnet. fixes #24607.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r24316 r24491  
    159159         * @param string $display_name Role display name.
    160160         * @param array $capabilities List of role capabilities in the above format.
    161          * @return null|WP_Role WP_Role object if role is added, null if already exists.
     161         * @return WP_Role|null WP_Role object if role is added, null if already exists.
    162162         */
    163163        function add_role( $role, $display_name, $capabilities = array() ) {
    … …  
    240240         *
    241241         * @param string $role Role name.
    242          * @return object|null Null, if role does not exist. WP_Role object, if found.
     242         * @return WP_Role|null WP_Role object if found, null if the role does not exist.
    243243         */
    244244        function get_role( $role ) {
    … …  
    13751375 *
    13761376 * @param string $role Role name.
    1377  * @return object
     1377 * @return WP_Role|null WP_Role object if found, null if the role does not exist.
    13781378 */
    13791379function get_role( $role ) {
    … …  
    13951395 * @param string $display_name Display name for role.
    13961396 * @param array $capabilities List of capabilities, e.g. array( 'edit_posts' => true, 'delete_posts' => false );
    1397  * @return null|WP_Role WP_Role object if role is added, null if already exists.
     1397 * @return WP_Role|null WP_Role object if role is added, null if already exists.
    13981398 */
    13991399function add_role( $role, $display_name, $capabilities = array() ) {
Note: See TracChangeset for help on using the changeset viewer.