WordPress.org

Make WordPress Core

Ticket #10696: 10696.patch

File 10696.patch, 1.8 KB (added by hakre, 5 years ago)
  • wp-admin/includes/template.php

     
    805805        if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) 
    806806                $posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>'; 
    807807        $posts_columns['date'] = __('Date'); 
     808        $posts_columns['page_template'] = __('Page Template'); 
    808809        $posts_columns = apply_filters('manage_pages_columns', $posts_columns); 
    809810 
    810811        return $posts_columns; 
     
    15961597                } 
    15971598        } 
    15981599 
     1600        $page_templates = array_flip(get_page_templates()); 
     1601        $page->page_template = get_post_meta( $page->ID, '_wp_page_template', true ); 
     1602        $page->page_template_nice = $page_templates[$page->page_template]; 
     1603        if ( 0 == strlen($page->page_template_nice) ) $page->page_template_nice = '-/-'; 
     1604 
    15991605        $page->post_title = esc_html( $page->post_title ); 
    16001606        $pad = str_repeat( '&#8212; ', $level ); 
    16011607        $id = (int) $page->ID; 
     
    17171723                <?php 
    17181724                break; 
    17191725 
     1726        case 'page_template': 
     1727                ?> 
     1728                <td <?php echo $attributes ?>><?php printf('<span title="%s">%s</span>', esc_attr($page->page_template), $page->page_template_nice); ?> </td> 
     1729                <?php 
     1730                break; 
     1731 
    17201732        default: 
    17211733                ?> 
    17221734                <td <?php echo $attributes ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td> 
     
    34433455function screen_meta($screen) { 
    34443456        global $wp_meta_boxes, $_wp_contextual_help; 
    34453457 
    3446         $screen = str_replace('.php', '', $screen); 
    3447         $screen = str_replace('-new', '', $screen); 
    3448         $screen = str_replace('-add', '', $screen); 
     3458        $screen = str_replace(array('.php', '-new', '-add' ), '', $screen); 
    34493459        $screen = apply_filters('screen_meta_screen', $screen); 
    34503460 
    34513461        $column_screens = get_column_headers($screen);