WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/04/2010 04:58:43 PM (10 years ago)
Author:
ryan
Message:

More custom post type support. Props scribu. see #9674

File:
1 edited

Legend:

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

    r12596 r12597  
    34833483
    34843484function screen_meta($screen) {
    3485     global $wp_meta_boxes, $_wp_contextual_help;
     3485    global $wp_meta_boxes, $_wp_contextual_help, $typenow;
    34863486
    34873487    $screen = str_replace('.php', '', $screen);
     
    34923492    $column_screens = get_column_headers($screen);
    34933493    $meta_screens = array('index' => 'dashboard');
     3494
     3495    // Give post_type pages their own screen
     3496    if ( 'post' == $screen ) {
     3497        if ( !empty($typenow) )
     3498            $screen = $typenow;
     3499    }
    34943500
    34953501    if ( isset($meta_screens[$screen]) )
     
    36763682
    36773683    $columns = array('dashboard' => 4, 'post' => 2, 'page' => 2, 'link' => 2);
     3684
     3685    // Add custom post types
     3686    foreach ( get_post_types( array('_show' => true) ) as $post_type )
     3687        $columns[$post_type] = 2;
     3688
    36783689    $columns = apply_filters('screen_layout_columns', $columns, $screen);
    36793690
     
    37553766
    37563767    if ( empty($name) ) {
    3757         if ( isset($parent_file) && !empty($parent_file) )
    3758             $name = substr($parent_file, 0, -4);
     3768        if ( isset($parent_file) && !empty($parent_file) ) {
     3769            $name = $parent_file;
     3770            if ( false !== $pos = strpos($name, '?post_type=') )
     3771                $name = substr($name, 0, $pos);
     3772            $name = substr($name, 0, -4);
     3773        }
    37593774        else
    37603775            $name = str_replace(array('.php', '-new', '-add'), '', $hook_suffix);
Note: See TracChangeset for help on using the changeset viewer.