[wp-trac] [WordPress Trac] #41445: post_parent can prevent media from embedding correctly

WordPress Trac noreply at wordpress.org
Fri Feb 17 07:59:02 UTC 2023


#41445: post_parent can prevent media from embedding correctly
-------------------------------------------------+-------------------------
 Reporter:  loboyle                              |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.2
Component:  Media                                |     Version:  4.9.4
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback needs-unit-tests has-   |     Focuses:  rest-api
  testing-info needs-patch needs-testing         |
-------------------------------------------------+-------------------------

Comment (by sandsine):

 Trying to reproduce this issue with the latest nightly build (2/17/2023).

 **Reproduce steps:**
 1. Create new post with new image and set as featured image, then publish
 the post.
 2. Create a second post with the same image (from 1.) and set as featured
 image, then publish the post.
 3. Get post data via WP JSON API:
 `http://<website_url>/wp-json/wp/v2/posts/<secondpost_id>?_embed`
 4. See result from JSON, the featured image was set, see this image
 [[Image(https://imgur.com/a/iLWyscG)]] and looking for `wp:featuredmedia`.
 5. Then delete the first post (from 1.)
 6. Refresh the WP JSON URL again (same URL as same as 3.) with and looking
 for `wp:featuredmedia`, the featured image meta data was deleted with the
 first post. You can see [[this image(https://imgur.com/a/MOWdHfd)]].
 ''(this's for after deleted the first post)''.

    * The JSON API request failed with status code 401 and code
 "rest_forbidden" with the latest nightly build (2/17/2023).
 7. ✅ Issue successfully reproduced.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41445#comment:59>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list