[wp-trac] [WordPress Trac] #32700: Allow media attachments in nav menus

WordPress Trac noreply at wordpress.org
Wed Jul 12 17:55:14 UTC 2017


#32700: Allow media attachments in nav menus
-------------------------------------------------+-------------------------
 Reporter:  bobbingwide                          |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Menus                                |  Review
 Severity:  normal                               |     Version:  4.7.3
 Keywords:  has-patch dev-feedback needs-unit-   |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------
Changes (by Rob_Huska):

 * version:   => 4.7.3


Comment:

 So adding the code below to {{{_wp_nav_menu_meta_box_object()}}} function
 in the {{{/wp-admin/includes/nav-menu.php}}}, my media files show up! I
 '''''DO NOT''''' want to do this. Is there any other way to inject this
 code or do something else to get the same results?

 {{{
         // Attachments have a status of 'inherit'
         } elseif ( 'attachment' == $object->name ) {
                 $object->_default_query = array(
                 'post_status' => 'inherit',
         );
 }}}

 It would be nice if I could filter and even set specific file types... I
 really only want to have the availability to add PDFs. I know I can go get
 the URL from the media library and add it as a Custom Link, but this is
 just so much nicer.

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


More information about the wp-trac mailing list