Make WordPress Core

Ticket #12695: twentytendoc.4.demetris.diff

File twentytendoc.4.demetris.diff, 18.1 KB (added by demetris, 15 years ago)

My first pass on jorbin’s first pass (twentytendoc.3.diff)

  • wp-content/themes/twentyten/404.php

     
     1<?php
     2/**
     3 * The template for displaying 404 pages (Not Found)
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313        <div id="container">
  • wp-content/themes/twentyten/archive.php

     
     1<?php
     2/**
     3 * Generic template for Archive pages
     4 *
     5 * Used to display archive-type pages if nothing more specific matches a query.
     6 * E.g., puts together date-based pages if no date.php file exists.
     7 * Learn more: http://codex.wordpress.org/Template_Hierarchy
     8 *
     9 * @since 0.7.0
     10 * @package WordPress
     11 * @subpackage 2010
     12 */
     13?>
     14
    115<?php get_header(); ?>
    216
    317                <div id="container">
  • wp-content/themes/twentyten/attachment.php

     
     1<?php
     2/**
     3 * The template used to display Attachment-type pages
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313                <div id="container">
  • wp-content/themes/twentyten/author.php

     
     1<?php
     2/**
     3 * The template used to display Author Archive pages
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313                <div id="container">
  • wp-content/themes/twentyten/category.php

     
     1<?php
     2/**
     3 * The template used to display Category Archive pages
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313                <div id="container">
     
    1323                                 * If you want to overload this in a child theme then include a file
    1424                                 * called loop-category.php and that will be used instead.
    1525                                 */
    16                                  get_template_part( 'loop', 'category' );
     26                                get_template_part( 'loop', 'category' );
    1727                                ?>
    1828
    1929                        </div><!-- #content -->
  • wp-content/themes/twentyten/comments.php

     
     1<?php
     2/**
     3 * The template used to display Comments
     4 *
     5 * The area of the page that contains both current comments
     6 * and the comment form.  The actual display of comments is
     7 * handled by a callback to twentyten_comment which is
     8 * located in the functions.php file
     9 *
     10 * @since 0.7.0
     11 * @package WordPress
     12 * @subpackage 2010
     13 */
     14?>
     15
    116                        <div id="comments">
    217<?php if ( post_password_required() ) : ?>
    318                                <div class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></div>
  • wp-content/themes/twentyten/footer.php

     
     1<?php
     2/**
     3 * The template used to display the footer
     4 *
     5 * Contains the closing of the id=main div and all content
     6 * after.  Calls sidebar-footer.php for bottom widgets
     7 *
     8 * @since 0.7.0
     9 * @package WordPress
     10 * @subpackage 2010
     11 */
     12?>
     13
    114        </div><!-- #main -->
    215
    316        <div id="footer">
  • wp-content/themes/twentyten/functions.php

     
    11<?php
     2/**
     3 * TwentyTen functions and definitions
     4 *
     5 * Sets up the theme and provides some helper functions used
     6 * in other parts of the theme.  All functions are pluggable
     7 *
     8 * @since 0.7.0
     9 * @package WordPress
     10 * @subpackage 2010
     11 */
    212
    3 // Set the content width based on the Theme CSS
     13// Set the content width based on the Theme CSS.  Can be overriden
    414if ( ! isset( $content_width ) )
    515        $content_width = 640;
    616
     17
     18/**
     19 * Set up defaults for our theme.
     20 *
     21 * Sets up theme defaults and tells wordpress that this is a
     22 * theme that will take advantage of Post Thumbnails, Custom
     23 * Background, Nav Menus and automatic feed links.  To
     24 * override any of the settings in a child theme, create your
     25 * own twentyten_init function
     26 *
     27 * @uses add_theme_support()
     28 *
     29 * @since 0.7.0
     30 *
     31 *
     32 */
     33
    734if ( ! function_exists( 'twentyten_init' ) ) :
    835function twentyten_init() {
    936        // Your Changeable header business starts here
     
    90117endif;
    91118add_action( 'after_setup_theme', 'twentyten_init' );
    92119
     120/**
     121 * Callback to style the header image inside the admin
     122 *
     123 *
     124 */
     125
    93126if ( ! function_exists( 'twentyten_admin_header_style' ) ) :
    94127function twentyten_admin_header_style() {
    95128?>
     
    106139}
    107140endif;
    108141
    109 // Get the page number
     142
     143/**
     144 * Returns the page number currently being browsed
     145 *
     146 * Returns a vertical bar followed by page and the page
     147 * number.  Is pluggable
     148 *
     149 * @since 0.7.0
     150 * @retun string
     151 */
     152
     153
    110154if ( ! function_exists( 'twentyten_get_page_number' ) ) :
    111155function twentyten_get_page_number() {
    112156        if ( get_query_var( 'paged' ) )
     
    114158}
    115159endif;
    116160
    117 // Echo the page number
     161/**
     162 * Echos the page number being browsed
     163 *
     164 * @since 0.7.0
     165 * @uses twentyten_get_page_number
     166 *
     167 */
     168
    118169if ( ! function_exists( 'twentyten_the_page_number' ) ) :
    119170function twentyten_the_page_number() {
    120171        echo twentyten_get_page_number();
    121172}
    122173endif;
    123174
    124 // Control excerpt length
     175/**
     176 * Sets the excerpt length to 40 charachters.  Is pluggable
     177 *
     178 * @since 0.7.0
     179 * @return int
     180 */
     181
    125182if ( ! function_exists( 'twentyten_excerpt_length' ) ) :
    126183function twentyten_excerpt_length( $length ) {
    127184        return 40;
     
    130187add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
    131188
    132189
    133 // Make a nice read more link on excerpts
     190/**
     191 * Sets the read more link for excerpts to something pretty
     192 *
     193 * @since 0.7.0
     194 * @return string
     195 *
     196 */
    134197if ( ! function_exists( 'twentyten_excerpt_more' ) ) :
    135198function twentyten_excerpt_more( $more ) {
    136199        return '&nbsp;&hellip; <a href="'. get_permalink() . '">' . __('Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
     
    139202add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
    140203
    141204
    142 // Template for comments and pingbacks
     205/**
     206 * Template for comments and pingbacks
     207 *
     208 * Used as a callback by wp_list_comments for displaying the
     209 * comments.  Is pluggable
     210 *
     211 * @since 0.7.0
     212 */
    143213if ( ! function_exists( 'twentyten_comment' ) ) :
    144214function twentyten_comment( $comment, $args, $depth ) {
    145215        $GLOBALS ['comment'] = $comment; ?>
     
    171241}
    172242endif;
    173243
    174 // Remove inline styles on gallery shortcode
     244/**
     245 * Remove inline styles on gallery shortcode
     246 *
     247 * @since 0.7.0
     248 * @return string
     249 */
    175250if ( ! function_exists( 'twentyten_remove_gallery_css' ) ) :
    176251function twentyten_remove_gallery_css( $css ) {
    177252        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
     
    179254endif;
    180255add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
    181256
     257/**
     258 * Returns the list of categories
     259 *
     260 * Returns the list of categories based on if we are or are
     261 * not browsing a category archive page.
     262 *
     263 * @uses twentyten_term_list
     264 *
     265 * @since 0.7.0
     266 * @return string
     267 */
     268
    182269if ( ! function_exists( 'twentyten_cat_list' ) ) :
    183270function twentyten_cat_list() {
    184271        return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) );
    185272}
    186273endif;
    187274
     275/**
     276 * Returns the list of tags
     277 *
     278 * Returns the list of tags based on if we are or are not
     279 * browsing a tag archive page
     280 *
     281 * @uses twentyten_term_list
     282 *
     283 * @since 0.7.0
     284 * @return string
     285 */
    188286if ( ! function_exists( 'twentyten_tag_list' ) ) :
    189287function twentyten_tag_list() {
    190288        return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) );
    191289}
    192290endif;
    193291
     292/**
     293 * Returns the list of taxonomy items in multiple ways
     294 *
     295 * Returns the list of taxonomy items differently based on
     296 * if we are browsing a term archive page or a different
     297 * type of page.  If browsing a term archive page and the
     298 * post has no other taxonomied terms, it returns empty
     299 *
     300 * @since 0.7.0
     301 * @return string
     302 */
    194303if ( ! function_exists( 'twentyten_term_list' ) ) :
    195304function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) {
    196305        global $wp_query, $post;
     
    219328}
    220329endif;
    221330
    222 // Register widgetized areas
     331/**
     332 * Register widgetized areas
     333 *
     334 * @since 0.7.0
     335 * @uses register_sidebar
     336 */
    223337if ( ! function_exists( 'twentyten_widgets_init' ) ) :
    224338function twentyten_widgets_init() {
    225339        // Area 1
  • wp-content/themes/twentyten/header.php

     
     1<?php
     2/**
     3 * The Header for our theme.
     4 *
     5 * Displays all of the <head> section and everything up till <div id="main">
     6 *
     7 * @since 0.7.0
     8 * @package WordPress
     9 * @subpackage 2010
     10 */
     11?>
     12
    113<!DOCTYPE html>
    214<html <?php language_attributes(); ?>>
    315<head>
     
    315        <meta charset="<?php bloginfo( 'charset' ); ?>" />
    416    <title><?php
     17        // Returns the title based on the type of page being viewed
    518        if ( is_single() ) {
    619                        single_post_title(); echo ' | '; bloginfo( 'name' );
  • wp-content/themes/twentyten/index.php

     
     1<?php
     2
     3/**
     4 * The main template file
     5 *
     6 * This is the most generic template file in a WordPress theme
     7 * and one of the two required files for a theme (the other being style.css).
     8 * It is used to display a page when nothing more specific matches a query.
     9 * E.g., it puts together the home page when no home.php file exists.
     10 * Learn more: http://codex.wordpress.org/Template_Hierarchy
     11 *
     12 * @since 0.7.0
     13 * @package WordPress
     14 * @subpackage 2010
     15 */
     16 
     17?>
     18 
    119<?php get_header(); ?>
    220
    321                <div id="container">
     
    1432                </div><!-- #container -->
    1533
    1634<?php get_sidebar(); ?>
    17 <?php get_footer(); ?>
     35<?php get_footer(); ?>
     36 No newline at end of file
  • wp-content/themes/twentyten/loop.php

     
     1<?php
     2/**
     3 * The loop that displays posts
     4 *
     5 * The loop displays the posts and the post content.  See
     6 * http://codex.wordpress.org/The_Loop to understand it and
     7 * http://codex.wordpress.org/Template_Tags to understand
     8 * the tags used in it.
     9 *
     10 * @since 0.7.0
     11 * @package WordPress
     12 * @subpackage 2010
     13 */
     14?>
     15
     16<?php /* Display navigation to next/previous pages when applicable  */ ?>
    117<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    218        <div id="nav-above" class="navigation">
    319                <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
     
    521        </div><!-- #nav-above -->
    622<?php endif; ?>
    723
     24<?php /* If there are no posts to display, such as an empty archive page  */ ?>
    825<?php if ( ! have_posts() ) : ?>
    926        <div id="post-0" class="post error404 not-found">
    1027                <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
     
    1532        </div><!-- #post-0 -->
    1633<?php endif; ?>
    1734
     35<?php /* Start the Loop  */ ?>
    1836<?php while ( have_posts() ) : the_post(); ?>
     37
     38<?php /* How to Display posts in the Gallery Category  */ ?>
    1939        <?php if ( in_category( 'Gallery' ) ) : ?>
    2040                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2141                        <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
     
    6282                        </div><!-- #entry-utility -->
    6383                </div>
    6484
    65 
     85<?php /* How to display posts in the asides category */ ?>
    6686        <?php elseif ( in_category( 'asides' ) ) : ?>
    6787                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    6888        <?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?>
     
    92112                        </div><!-- #entry-utility -->
    93113                </div><!-- #post-<?php the_ID(); ?> -->
    94114
    95 
     115<?php /* How to display all other posts  */ ?>
    96116        <?php else : ?>
    97117                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    98118                        <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
     
    139159        <?php endif; // if different categories queried ?>
    140160<?php endwhile; ?>
    141161
     162<?php /* Display navigation to next/previous pages when applicable  */ ?>
    142163<?php if (  $wp_query->max_num_pages > 1 ) : ?>
    143164                                <div id="nav-below" class="navigation">
    144165                                        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  • wp-content/themes/twentyten/onecolumn-page.php

     
    1 
    21<?php
    3 /*
    4 Template Name: One column, no sidebar
    5 Description: A template with no sidebar
    6 */
    7 get_header(); ?>
     2/**
     3 * Template Name: One column, no sidebar
     4 *
     5 * A custom page template without sidebar.
     6 * Selectable from a dropdown menu on the edit page screen.
     7 *
     8 * @since 0.7.0
     9 * @package WordPress
     10 * @subpackage 2010
     11 */
     12?>
    813
     14<?php get_header(); ?>
     15
    916                <div id="container" class="onecolumn">
    1017                        <div id="content">
    1118
  • wp-content/themes/twentyten/page.php

     
     1<?php
     2/**
     3 * The template used to display all pages
     4 *
     5 * This is the template that displays all pages by default.
     6 * Please note that this is the wordpress construct of pages
     7 * and that other 'pages' on your wordpress site will use a
     8 * different template.
     9 *
     10 * @since 0.7.0
     11 * @package WordPress
     12 * @subpackage 2010
     13 */
     14?>
     15
    116<?php get_header(); ?>
    217
    318                <div id="container">
  • wp-content/themes/twentyten/search.php

     
     1<?php
     2/**
     3 * The Search Results template
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313                <div id="container">
  • wp-content/themes/twentyten/searchform.php

     
     1<?php
     2/**
     3 * The Search Form
     4 *
     5 * Optional file that allows displaying a custom search form
     6 * when the get_search_form() template tag is used.
     7 *
     8 * @since 0.7.0
     9 * @package WordPress
     10 * @subpackage 2010
     11 */
     12?>
     13
    114    <form id="searchform" name="searchform" method="get" action="<?php echo home_url(); ?>">
    215                <div>
    316                        <label for="s"><?php _e( 'Search', 'twentyten' ); ?></label>
  • wp-content/themes/twentyten/sidebar-footer.php

     
    11<?php
     2/**
     3 * The Footer widget areas
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
     11<?php
    212        if (
    313                is_active_sidebar( 'first-footer-widget-area' )  ||
    414                is_active_sidebar( 'second-footer-widget-area' ) ||
  • wp-content/themes/twentyten/sidebar.php

     
     1<?php
     2/**
     3 * The Sidebar containing the primary and secondary widget areas
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111                <div id="primary" class="widget-area">
    212                        <ul class="xoxo">
    313<?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : // begin primary widget area ?>
  • wp-content/themes/twentyten/single.php

     
     1<?php
     2/**
     3 * The Template used to display all single posts
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313                <div id="container">
  • wp-content/themes/twentyten/tag.php

     
     1<?php
     2/**
     3 * The template used to display Tag Archive pages
     4 *
     5 * @since 0.7.0
     6 * @package WordPress
     7 * @subpackage 2010
     8 */
     9?>
     10
    111<?php get_header(); ?>
    212
    313                <div id="container">