WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/04/2014 06:05:46 AM (8 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation for the __construct() and add() methods in WP_Error class.

Props jdgrimes.
Fixes #28203.

File:
1 edited

Legend:

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

    r28524 r28660  
    3939
    4040    /**
    41      * Constructor - Sets up error message.
    42      *
    43      * If code parameter is empty then nothing will be done. It is possible to
    44      * add multiple messages to the same code, but with other methods in the
    45      * class.
    46      *
    47      * All parameters are optional, but if the code parameter is set, then the
    48      * data parameter is optional.
     41     * Initialize the error.
     42     *
     43     * If `$code` is empty, the other parameters will be ignored.
     44     * When `$code` is not empty, `$message` will be used even if
     45     * it is empty. The `$data` parameter will be used only if it
     46     * is not empty.
     47     *
     48     * Though the class is constructed with a single error code and
     49     * message, multiple codes can be added using the `add()` method.
    4950     *
    5051     * @since 2.1.0
     
    5556     * @return WP_Error
    5657     */
    57     public function __construct($code = '', $message = '', $data = '') {
     58    public function __construct( $code = '', $message = '', $data = '' ) {
    5859        if ( empty($code) )
    5960            return;
     
    204205
    205206    /**
    206      * Append more error messages to list of error messages.
     207     * Add an error or append additional message to an existing error.
    207208     *
    208209     * @since 2.1.0
Note: See TracChangeset for help on using the changeset viewer.