[wp-trac] [WordPress Trac] #54965: Custom post type set as not public breaks media uploader functionality

WordPress Trac noreply at wordpress.org
Fri Jan 28 02:28:35 UTC 2022


#54965: Custom post type set as not public breaks media uploader functionality
-------------------------------+------------------------------
 Reporter:  catacaustic        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  5.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by costdev):

 * keywords:   => reporter-feedback


Comment:

 == Test Report

 === Environment
 * **WordPress:** 5.9 and 6.0-alpha-52448-src
 * **Browser:** Chrome 97.0.4692.71
 * **OS:** Windows 10
 * ** Editor:** Block Editor
 * **Theme(s):** Twenty Twenty-One and Twenty Twenty-Two
 * **Plugin(s)**: None activated

 === Steps to reproduce
 1. Add a new post type using:

 {{{#!php
 <?php

 add_action(
         'init',
         function() {
                 register_post_type(
                         'my_cpt',
                         array(
                                 'labels'       => array( 'name' => 'My
 CPT' ),
                                 'public'       => false,
                                 'show_ui'      => true,
                                 'show_in_rest' => true
                         )
                 );
         },
         999
 );
 }}}
 2. Open the dashboard and navigate to `My CPT > Add New`.
 3. Insert a Gallery block.
 4. Click `Upload` and proceed to upload an image.
 5. Click `Media Library`.
 6. Under `Filter Media`, select `Uploaded to this post`.
 7. The image you uploaded should be displayed.
 8. Click `Publish`, then `Publish`.
 9. Navigate to `Media > Library`.
 10. Click the list view icon (the first one).
 11. In the `Uploaded to` column for the image you uploaded, it should say
 `(Private post)` with a `Detach` link underneath.

 === Results
 - Uploaded image is displayed under `Uploaded to this post`. ✅
 - `Uploaded to` column for the uploaded image says `(Private post)`. ✅
 - Cannot reproduce. ❌


 ----

 Hi @catacaustic, welcome to Trac!

 I was unable to reproduce this issue. Can you let us know if any of the
 steps above are incorrect, or if there are any missing steps?

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


More information about the wp-trac mailing list