[wp-trac] [WordPress Trac] #57897: REST attachments controller does not handle terms on creation
WordPress Trac
noreply at wordpress.org
Mon Sep 18 09:31:45 UTC 2023
#57897: REST attachments controller does not handle terms on creation
-------------------------------------------------+-------------------------
Reporter: swissspidy | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests has- | Focuses: rest-api
testing-info needs-testing |
-------------------------------------------------+-------------------------
Changes (by Dharm1025):
* keywords: has-patch needs-testing-info has-unit-tests => has-patch has-
unit-tests has-testing-info needs-testing
Comment:
== Testing Instructions
=== Steps to test
1. Apply [https://github.com/WordPress/wordpress-develop/pull/5238 PR
5238]
2. Register a new taxonomy for the **attachment** object type with
`show_in_rest` set to `true` OR add an already registered taxonomy to an
attachment. For example:
{{{#!php
<?php
register_taxonomy_for_object_type( 'category', 'attachment' );
}}}
3. Send a REST API request to create an attachment with taxonomy terms.
(For more information, refer to the [https://developer.wordpress.org/rest-
api/reference/media/#create-a-media-item WordPress REST API
documentation]).
=== Expected Results
* ✅ Taxonomy terms included in the API request should be assigned to the
newly created attachment.
cc: @ankit-k-gupta (as you requested testing instructions earlier)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57897#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list