Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php

    r46586 r47122  
    105105        public function test_get_item_value_is_cast_to_type() {
    106106                wp_set_current_user( self::$administrator );
    107                 update_option( 'posts_per_page', 'invalid_number' ); // this is cast to (int) 1
     107                update_option( 'posts_per_page', 'invalid_number' ); // This is cast to (int) 1.
    108108                $request  = new WP_REST_Request( 'GET', '/wp/v2/settings' );
    109109                $response = rest_get_server()->dispatch( $request );
    … …  
    183183                $this->assertEquals( array(), $data['mycustomsetting'] );
    184184
    185                 // Invalid value
     185                // Invalid value.
    186186                update_option( 'mycustomsetting', array( array( 1 ) ) );
    187187                $request  = new WP_REST_Request( 'GET', '/wp/v2/settings' );
    … …  
    190190                $this->assertEquals( null, $data['mycustomsetting'] );
    191191
    192                 // No option value
     192                // No option value.
    193193                delete_option( 'mycustomsetting' );
    194194                $request  = new WP_REST_Request( 'GET', '/wp/v2/settings' );
    … …  
    239239                $this->assertEquals( array(), $data['mycustomsetting'] );
    240240
    241                 // Invalid value
     241                // Invalid value.
    242242                update_option(
    243243                        'mycustomsetting',
    … …  
    380380        public function update_setting_custom_callback( $result, $name, $value, $args ) {
    381381                if ( 'title' === $name && 'The new title!' === $value ) {
    382                         // Do not allow changing the title in this case
     382                        // Do not allow changing the title in this case.
    383383                        return true;
    384384                }
Note: See TracChangeset for help on using the changeset viewer.