Make WordPress Core


Ignore:
Timestamp:
04/29/2022 07:22:56 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Formatting corrections for various docblocks.

See #54729

File:
1 edited

Legend:

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

    r52707 r53317  
    2929 *
    3030 * Exceptions:
     31 *
    3132 * 1. When the option has not been saved in the database, the `$default` value
    3233 *    is returned if provided. If not, boolean `false` is returned.
    33  * 2. When one of the Options API filters is used: {@see 'pre_option_{$option}'},
    34  *    {@see 'default_option_{$option}'}, or {@see 'option_{$option}'}, the returned
     34 * 2. When one of the Options API filters is used: {@see 'pre_option_$option'},
     35 *    {@see 'default_option_$option'}, or {@see 'option_$option'}, the returned
    3536 *    value may not match the expected type.
    3637 * 3. When the option has just been saved in the database, and get_option()
     
    4041 * Examples:
    4142 *
    42  * When adding options like this: `add_option( 'my_option_name', 'value' );`
    43  * and then retrieving them with `get_option( 'my_option_name' );`, the returned
     43 * When adding options like this: `add_option( 'my_option_name', 'value' )`
     44 * and then retrieving them with `get_option( 'my_option_name' )`, the returned
    4445 * values will be:
    4546 *
    46  * `false` returns `string(0) ""`
    47  * `true`  returns `string(1) "1"`
    48  * `0`     returns `string(1) "0"`
    49  * `1`     returns `string(1) "1"`
    50  * `'0'`   returns `string(1) "0"`
    51  * `'1'`   returns `string(1) "1"`
    52  * `null`  returns `string(0) ""`
     47 *   - `false` returns `string(0) ""`
     48 *   - `true`  returns `string(1) "1"`
     49 *   - `0`     returns `string(1) "0"`
     50 *   - `1`     returns `string(1) "1"`
     51 *   - `'0'`   returns `string(1) "0"`
     52 *   - `'1'`   returns `string(1) "1"`
     53 *   - `null`  returns `string(0) ""`
    5354 *
    5455 * When adding options with non-scalar values like
    55  * `add_option( 'my_array', array( false, 'str', null ) );`, the returned value
     56 * `add_option( 'my_array', array( false, 'str', null ) )`, the returned value
    5657 * will be identical to the original as it is serialized before saving
    5758 * it in the database:
    5859 *
    59  *    array(3) {
    60  *        [0] => bool(false)
    61  *        [1] => string(3) "str"
    62  *        [2] => NULL
    63  *    }
     60 *     array(3) {
     61 *         [0] => bool(false)
     62 *         [1] => string(3) "str"
     63 *         [2] => NULL
     64 *     }
    6465 *
    6566 * @since 1.5.0
Note: See TracChangeset for help on using the changeset viewer.