WordPress.org

Make WordPress Core

Changeset 14602


Ignore:
Timestamp:
05/13/10 17:29:45 (4 years ago)
Author:
ryan
Message:

Add show_in_nav_menus flag to post type registration. Props williamsba1. fixes #13144

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/nav-menu.php

    r14598 r14602  
    363363 */ 
    364364function wp_nav_menu_post_type_meta_boxes() { 
    365     $post_types = get_post_types( array( 'public' => true ), 'object' ); 
     365    $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); 
    366366 
    367367    if ( ! $post_types ) 
  • trunk/wp-includes/post.php

    r14593 r14602  
    801801        'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 
    802802        'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 
    803         'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 
     803        'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 'show_in_nav_menus' => null 
    804804    ); 
    805805    $args = wp_parse_args($args, $defaults); 
     
    816816    if ( null === $args->show_ui ) 
    817817        $args->show_ui = $args->public; 
     818 
     819    // Whether to show this type in nav-menus.php.  Defaults to the setting for public. 
     820    if ( null === $args->show_in_nav_menus ) 
     821        $args->show_in_nav_menus = $args->public; 
    818822 
    819823    // If not set, default to true if not public, false if public. 
Note: See TracChangeset for help on using the changeset viewer.