WordPress.org

Make WordPress Core

Changeset 8718


Ignore:
Timestamp:
08/23/08 09:49:52 (6 years ago)
Author:
westi
Message:

Add names for attachment templates, fix page template name extraction. See #7576.

File:
1 edited

Legend:

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

    r8716 r8718  
    11<?php 
    22 
    3 $wp_file_descriptions = array ('index.php' => __( 'Main Index Template' ), 'style.css' => __( 'Stylesheet' ), 'rtl.css' => __( 'RTL Stylesheet' ), 'comments.php' => __( 'Comments' ), 'comments-popup.php' => __( 'Popup Comments' ), 'footer.php' => __( 'Footer' ), 'header.php' => __( 'Header' ), 'sidebar.php' => __( 'Sidebar' ), 'archive.php' => __( 'Archives' ), 'category.php' => __( 'Category Template' ), 'page.php' => __( 'Page Template' ), 'search.php' => __( 'Search Results' ), 'searchform.php' => __( 'Search Form' ), 'single.php' => __( 'Single Post' ), '404.php' => __( '404 Template' ), 'link.php' => __( 'Links Template' ), 'functions.php' => __( 'Theme Functions' ), 'attachment.php' => __( 'Attachment Template' ), 'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ), '.htaccess' => __( '.htaccess (for rewrite rules )' ), 
     3$wp_file_descriptions = array ( 
     4    'index.php' => __( 'Main Index Template' ), 
     5    'style.css' => __( 'Stylesheet' ), 
     6    'rtl.css' => __( 'RTL Stylesheet' ),  
     7    'comments.php' => __( 'Comments' ),  
     8    'comments-popup.php' => __( 'Popup Comments' ),  
     9    'footer.php' => __( 'Footer' ),  
     10    'header.php' => __( 'Header' ),  
     11    'sidebar.php' => __( 'Sidebar' ), 
     12    'archive.php' => __( 'Archives' ), 
     13    'category.php' => __( 'Category Template' ), 
     14    'page.php' => __( 'Page Template' ), 
     15    'search.php' => __( 'Search Results' ), 
     16    'searchform.php' => __( 'Search Form' ), 
     17    'single.php' => __( 'Single Post' ), 
     18    '404.php' => __( '404 Template' ), 
     19    'link.php' => __( 'Links Template' ), 
     20    'functions.php' => __( 'Theme Functions' ), 
     21    'attachment.php' => __( 'Attachment Template' ), 
     22    'image.php' => __('Image Attachment Template'), 
     23    'video.php' => __('Video Attachment Template'), 
     24    'audio.php' => __('Audio Attachment Template'), 
     25    'application.php' => __('Application Attachment Template'), 
     26    'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ), 
     27    '.htaccess' => __( '.htaccess (for rewrite rules )' ), 
    428    // Deprecated files 
    529    'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); 
     
    1034        return $wp_file_descriptions[basename( $file )]; 
    1135    } 
    12     elseif ( file_exists( WP_CONTENT_PATH . $file ) && is_file( WP_CONTENT_PATH . $file ) ) { 
    13         $template_data = implode( '', file( WP_CONTENT_PATH . $file ) ); 
    14         if ( preg_match( "|Template Name:(.*)|i", $template_data, $name )) 
    15             return $name[1]; 
     36    elseif ( file_exists( WP_CONTENT_DIR . $file ) && is_file( WP_CONTENT_DIR . $file ) ) { 
     37        $template_data = implode( '', file( WP_CONTENT_DIR . $file ) ); 
     38        if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name )) 
     39            return $name[1] . ' Page Template'; 
    1640    } 
    1741 
Note: See TracChangeset for help on using the changeset viewer.