WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/23/2019 05:39:36 PM (8 weeks ago)
Author:
kadamwhite
Message:

REST API: Introduce date_floating property on status endpoint response objects.

Expose a date_floating property on all status objects to permit clients (including the block editor) to make correct decisions about date handling for posts of varying status.

Props mnelson4, earnjam, kadamwhite, jnylen0, nerrad, pento.
See #39953.

File:
1 edited

Legend:

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

    r43571 r46252  
    154154        $data       = $response->get_data();
    155155        $properties = $data['schema']['properties'];
    156         $this->assertEquals( 7, count( $properties ) );
     156        $this->assertEquals( 8, count( $properties ) );
    157157        $this->assertArrayHasKey( 'name', $properties );
    158158        $this->assertArrayHasKey( 'private', $properties );
     
    162162        $this->assertArrayHasKey( 'show_in_list', $properties );
    163163        $this->assertArrayHasKey( 'slug', $properties );
     164        $this->assertArrayhasKey( 'date_floating', $properties );
    164165    }
    165166
     
    218219            array_keys( $links )
    219220        );
     221        $this->assertEquals( $status_obj->date_floating, $data['date_floating'] );
    220222    }
    221223
Note: See TracChangeset for help on using the changeset viewer.