mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
REST API: Support generating comment up links to custom posts controllers.
The comments controller now uses the `rest_get_route_for_post` function introduced in WordPress 5.5 to generate the link. This function is filterable to allow for custom controllers to properly define their REST API route. Props dsifford, TimothyBlynJacobs. Fixes #44152. git-svn-id: https://develop.svn.wordpress.org/trunk@49299 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3254,6 +3254,10 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase
|
||||
array_keys( $links )
|
||||
);
|
||||
|
||||
if ( $comment->comment_post_ID ) {
|
||||
$this->assertEquals( rest_url( '/wp/v2/posts/' . $comment->comment_post_ID ), $links['up'][0]['href'] );
|
||||
}
|
||||
|
||||
if ( 'edit' === $context ) {
|
||||
$this->assertSame( $comment->comment_author_email, $data['author_email'] );
|
||||
$this->assertSame( $comment->comment_author_IP, $data['author_ip'] );
|
||||
|
||||
Reference in New Issue
Block a user