[wp-trac] [WordPress Trac] #28219: add_media 'Uploaded to this post' listing unattached files when post type does not support 'thumbnail'

WordPress Trac noreply at wordpress.org
Wed May 28 18:45:06 UTC 2014


#28219: add_media 'Uploaded to this post' listing unattached files when post type
does not support 'thumbnail'
-------------------------------+------------------------------
 Reporter:  bobbingwide        |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  3.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------
Changes (by ericlewis):

 * keywords:  2nd-opinion => reporter-feedback


Comment:

 @min thanks for those steps, but I still can't reproduce.

 1. Activated twentytwelve
 2. Uploaded an image in wp-admin/media-new.php
 3. Commented out twentytwelve/functions.php:75-76
 {{{
 #!php
 // add_theme_support( 'post-thumbnails' );
 // set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop
 }}}
 4. Added some custom post type boilerplate into an mu-plugin
 {{{
 #!php
 <?php

 add_action( 'init', 'codex_book_init' );
 /**
  * Register a book post type.
  *
  * @link http://codex.wordpress.org/Function_Reference/register_post_type
  */
 function codex_book_init() {
         $labels = array(
                 'name'               => _x( 'Books', 'post type general
 name', 'your-plugin-textdomain' ),
                 'singular_name'      => _x( 'Book', 'post type singular
 name', 'your-plugin-textdomain' ),
                 'menu_name'          => _x( 'Books', 'admin menu', 'your-
 plugin-textdomain' ),
                 'name_admin_bar'     => _x( 'Book', 'add new on admin
 bar', 'your-plugin-textdomain' ),
                 'add_new'            => _x( 'Add New', 'book', 'your-
 plugin-textdomain' ),
                 'add_new_item'       => __( 'Add New Book', 'your-plugin-
 textdomain' ),
                 'new_item'           => __( 'New Book', 'your-plugin-
 textdomain' ),
                 'edit_item'          => __( 'Edit Book', 'your-plugin-
 textdomain' ),
                 'view_item'          => __( 'View Book', 'your-plugin-
 textdomain' ),
                 'all_items'          => __( 'All Books', 'your-plugin-
 textdomain' ),
                 'search_items'       => __( 'Search Books', 'your-plugin-
 textdomain' ),
                 'parent_item_colon'  => __( 'Parent Books:', 'your-plugin-
 textdomain' ),
                 'not_found'          => __( 'No books found.', 'your-
 plugin-textdomain' ),
                 'not_found_in_trash' => __( 'No books found in Trash.',
 'your-plugin-textdomain' ),
         );

         $args = array(
                 'labels'             => $labels,
                 'public'             => true,
                 'publicly_queryable' => true,
                 'show_ui'            => true,
                 'show_in_menu'       => true,
                 'query_var'          => true,
                 'rewrite'            => array( 'slug' => 'book' ),
                 'capability_type'    => 'post',
                 'has_archive'        => true,
                 'hierarchical'       => false,
                 'menu_position'      => null,
                 'supports'           => array( 'title', 'editor',
 'author', 'thumbnail', 'excerpt', 'comments' )
         );

         register_post_type( 'book', $args );
 }
 }}}
 5. Created a new 'Book', open the media modal, and select the 'Uploaded to
 this Post' in the filter dropdown, see no media.

 Please make sure you have no plugins enabled and are testing on a default
 theme, and if you see any errors in your Javascript console.

 If you can still reproduce, a screencast documenting the process of
 creating the bug would be very helpful.

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


More information about the wp-trac mailing list