WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/11/2018 04:00:37 AM (3 years ago)
Author:
jorbin
Message:

REST API: Persist attributes for attachment links

In [43437], the link definition implementation caused attachment links to be unexpectedly nested under an attributes key. This changeset restores the prior behavior.

Merges [43681] to trunk.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44750.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r43571 r43973  
    14681468
    14691469        $this->assertArrayHasKey( 'self', $links );
     1470        $this->assertArrayHasKey( 'author', $links );
     1471
     1472        $this->assertCount( 1, $links['author'] );
     1473        $this->assertArrayHasKey( 'embeddable', $links['author'][0]['attributes'] );
     1474        $this->assertTrue( $links['author'][0]['attributes']['embeddable'] );
    14701475    }
    14711476
Note: See TracChangeset for help on using the changeset viewer.