Ticket #12695: twentytendoc.2.diff

File twentytendoc.2.diff, 16.4 KB (added by jorbin, 3 years ago)

cleaned it up a bit

Line 
1Index: wp-content/themes/twentyten/searchform.php
2===================================================================
3--- wp-content/themes/twentyten/searchform.php  (revision 13836)
4+++ wp-content/themes/twentyten/searchform.php  (working copy)
5@@ -1,3 +1,13 @@
6+<?php
7+/**
8+ * The Search Form
9+ *
10+ * Displays the search form when the get_search_form()
11+ * template tag is used.
12+ *
13+ * @package twenty-ten
14+ */
15+?>
16     <form id="searchform" name="searchform" method="get" action="<?php echo home_url(); ?>">
17                <div>
18                        <label for="s"><?php _e( 'Search', 'twentyten' ); ?></label>
19Index: wp-content/themes/twentyten/footer.php
20===================================================================
21--- wp-content/themes/twentyten/footer.php      (revision 13836)
22+++ wp-content/themes/twentyten/footer.php      (working copy)
23@@ -1,3 +1,13 @@
24+<?php
25+/**
26+ * The template used to display the footer
27+ *
28+ * Contains the closing of the id=main div and all content
29+ * after.  Calls sidebar-footer.php for bottom widgets
30+ *
31+ * @package twenty-ten
32+ */
33+?>
34        </div><!-- #main -->
35
36        <div id="footer">
37Index: wp-content/themes/twentyten/author.php
38===================================================================
39--- wp-content/themes/twentyten/author.php      (revision 13836)
40+++ wp-content/themes/twentyten/author.php      (working copy)
41@@ -1,3 +1,10 @@
42+<?php
43+/**
44+ * The template used to display Author Archive pages
45+ *
46+ * @package twenty-ten
47+ */
48+?>
49 <?php get_header(); ?>
50
51                <div id="container">
52Index: wp-content/themes/twentyten/sidebar-footer.php
53===================================================================
54--- wp-content/themes/twentyten/sidebar-footer.php      (revision 13836)
55+++ wp-content/themes/twentyten/sidebar-footer.php      (working copy)
56@@ -1,4 +1,11 @@
57 <?php
58+/**
59+ * The Footer widget areas
60+ *
61+ * @package twenty-ten
62+ */
63+?>
64+<?php
65        if (
66                is_active_sidebar( 'first-footer-widget-area' )  ||
67                is_active_sidebar( 'second-footer-widget-area' ) ||
68Index: wp-content/themes/twentyten/search.php
69===================================================================
70--- wp-content/themes/twentyten/search.php      (revision 13836)
71+++ wp-content/themes/twentyten/search.php      (working copy)
72@@ -1,3 +1,10 @@
73+<?php
74+/**
75+ * The Search Results template
76+ *
77+ * @package twenty-ten
78+ */
79+?>
80 <?php get_header(); ?>
81
82                <div id="container">
83Index: wp-content/themes/twentyten/404.php
84===================================================================
85--- wp-content/themes/twentyten/404.php (revision 13836)
86+++ wp-content/themes/twentyten/404.php (working copy)
87@@ -1,3 +1,10 @@
88+<?php
89+/**
90+ * The template for displaying a 404 page not found error
91+ *
92+ * @package twenty-ten
93+ */
94+?>
95 <?php get_header(); ?>
96
97        <div id="container">
98Index: wp-content/themes/twentyten/functions.php
99===================================================================
100--- wp-content/themes/twentyten/functions.php   (revision 13836)
101+++ wp-content/themes/twentyten/functions.php   (working copy)
102@@ -1,9 +1,33 @@
103 <?php
104+/**
105+ * TwentyTen functions and definitions
106+ *
107+ * Sets up the theme and provides some helper functions used
108+ * in other parts of the theme.  All functions are pluggable
109+ *
110+ * @package twenty-ten
111+ */
112
113-// Set the content width based on the Theme CSS
114+// Set the content width based on the Theme CSS.  Can be overriden
115 if ( ! isset( $content_width ) )
116        $content_width = 640;
117
118+
119+/**
120+/* Set up defaults for our theme.
121+ *
122+ * Sets up theme defaults and tells wordpress that this is a
123+ * theme that will take advantage of Post Thumbnails, Custom
124+ * Background, Nav Menus and automatic feed links.  To
125+ * override any of the settings in a child theme, create your
126+ * own twentyten_init function
127+ *
128+ * @uses add_theme_support()
129+ *
130+ * @since 0.7
131+ *
132+ *
133+ */
134+
135 if ( ! function_exists( 'twentyten_init' ) ) :
136 function twentyten_init() {
137        // Your Changeable header business starts here
138@@ -90,6 +114,12 @@
139 endif;
140 add_action( 'after_setup_theme', 'twentyten_init' );
141
142+/**
143+ * Callback to style the header image inside the admin
144+ *
145+ *
146+ */
147+
148 if ( ! function_exists( 'twentyten_admin_header_style' ) ) :
149 function twentyten_admin_header_style() {
150 ?>
151@@ -106,7 +136,18 @@
152 }
153 endif;
154
155-// Get the page number
156+
157+/**
158+ * Returns the page number currently being browsed
159+ *
160+ * Returns a vertical bar followed by page and the page
161+ * number.  Is pluggable
162+ *
163+ * @since 0.7
164+ * @retun string
165+ */
166+
167+
168 if ( ! function_exists( 'twentyten_get_page_number' ) ) :
169 function twentyten_get_page_number() {
170        if ( get_query_var( 'paged' ) )
171@@ -114,14 +155,27 @@
172 }
173 endif;
174
175-// Echo the page number
176+/**
177+ * Echos the page number being browsed
178+ *
179+ * @since 0.7
180+ * @uses twentyten_get_page_number
181+ *
182+ */
183+
184 if ( ! function_exists( 'twentyten_the_page_number' ) ) :
185 function twentyten_the_page_number() {
186        echo twentyten_get_page_number();
187 }
188 endif;
189
190-// Control excerpt length
191+/**
192+ * Sets the excerpt length to 40 charachters.  Is pluggable
193+ *
194+ * @since 0.7
195+ * @return int
196+ */
197+
198 if ( ! function_exists( 'twentyten_excerpt_length' ) ) :
199 function twentyten_excerpt_length( $length ) {
200        return 40;
201@@ -130,7 +184,12 @@
202 add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
203
204
205-// Make a nice read more link on excerpts
206+/**
207+ * Sets the read more link for excerpts to something pretty
208+ *
209+ * @since 0.7
210+ * @return string
211+ *
212+ */
213 if ( ! function_exists( 'twentyten_excerpt_more' ) ) :
214 function twentyten_excerpt_more( $more ) {
215        return '&nbsp;&hellip; <a href="'. get_permalink() . '">' . __('Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
216@@ -139,7 +198,14 @@
217 add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
218
219
220-// Template for comments and pingbacks
221+/**
222+ * Template for comments and pingbacks
223+ *
224+ * Used as a callback by wp_list_comments for displaying the
225+ * comments.  Is pluggable
226+ *
227+ * @since 0.7
228+ */
229 if ( ! function_exists( 'twentyten_comment' ) ) :
230 function twentyten_comment( $comment, $args, $depth ) {
231        $GLOBALS ['comment'] = $comment; ?>
232@@ -171,7 +237,12 @@
233 }
234 endif;
235
236-// Remove inline styles on gallery shortcode
237+/**
238+ * Remove inline styles on gallery shortcode
239+ *
240+ * @since 0.7
241+ * @return string
242+ */
243 if ( ! function_exists( 'twentyten_remove_gallery_css' ) ) :
244 function twentyten_remove_gallery_css( $css ) {
245        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
246@@ -179,18 +250,52 @@
247 endif;
248 add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
249
250+/**
251+ * Returns the list of catagories
252+ *
253+ * Returns the list of catagories based on if we are or are
254+ * not browsing a catagory archive page.
255+ *
256+ * @uses twentyten_term_list
257+ *
258+ * @since 0.7
259+ * @return string
260+ */
261+
262 if ( ! function_exists( 'twentyten_cat_list' ) ) :
263 function twentyten_cat_list() {
264        return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) );
265 }
266 endif;
267
268+/**
269+ * Returns the list of tags
270+ *
271+ * Returns the list of tags based on if we are or are not
272+ * browsing a tag archive page
273+ *
274+ * @uses twentyten_term_list
275+ *
276+ * @since 0.7
277+ * @return string
278+ */
279 if ( ! function_exists( 'twentyten_tag_list' ) ) :
280 function twentyten_tag_list() {
281        return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) );
282 }
283 endif;
284
285+/**
286+ * Returns the list of taxonomy items in multiple ways
287+ *
288+ * Returns the list of taxonomy items differently based on
289+ * if we are browsing a term archive page or a different
290+ * type of page.  If browsing a term archive page and the
291+ * post has no other taxonomied terms, it returns empty
292+ *
293+ * @since 0.7
294+ * @return string
295+ */
296 if ( ! function_exists( 'twentyten_term_list' ) ) :
297 function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) {
298        global $wp_query, $post;
299@@ -219,7 +324,12 @@
300 }
301 endif;
302
303-// Register widgetized areas
304+/**
305+ * Register widgetized areas
306+ *
307+ * @since 0.7
308+ * @uses register_sidebar
309+ */
310 if ( ! function_exists( 'twentyten_widgets_init' ) ) :
311 function twentyten_widgets_init() {
312        // Area 1
313Index: wp-content/themes/twentyten/loop.php
314===================================================================
315--- wp-content/themes/twentyten/loop.php        (revision 13836)
316+++ wp-content/themes/twentyten/loop.php        (working copy)
317@@ -1,3 +1,16 @@
318+<?php
319+/**
320+ * The loop that displays posts
321+ *
322+ * The loop displays the posts and the post content.  See
323+ * http://codex.wordpress.org/The_Loop to understand it and
324+ * http://codex.wordpress.org/Template_Tags to understand
325+ * the tags used in it.
326+ *
327+ * @package twenty-ten
328+ */
329+?>
330+<?php /* Display navigation to next/previous pages when applicable  */ ?>
331 <?php if ( $wp_query->max_num_pages > 1 ) : ?>
332        <div id="nav-above" class="navigation">
333                <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
334@@ -5,6 +18,7 @@
335        </div><!-- #nav-above -->
336 <?php endif; ?>
337
338+<?php /* If there are no posts to display, such as an empty archive page  */ ?>
339 <?php if ( ! have_posts() ) : ?>
340        <div id="post-0" class="post error404 not-found">
341                <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
342@@ -15,7 +29,10 @@
343        </div><!-- #post-0 -->
344 <?php endif; ?>
345
346+<?php /* Start the Loop  */ ?>
347 <?php while ( have_posts() ) : the_post(); ?>
348+
349+<?php /* How to Display posts in the Gallery Category  */ ?>
350        <?php if ( in_category( 'Gallery' ) ) : ?>
351                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
352                        <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>
353@@ -62,7 +79,7 @@
354                        </div><!-- #entry-utility -->
355                </div>
356
357-
358+<?php /* How to display posts in the asides category */ ?>
359        <?php elseif ( in_category( 'asides' ) ) : ?>
360                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
361        <?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?>
362@@ -92,7 +109,7 @@
363                        </div><!-- #entry-utility -->
364                </div><!-- #post-<?php the_ID(); ?> -->
365
366-
367+<?php /* How to display all other posts  */ ?>
368        <?php else : ?>
369                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
370                        <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>
371@@ -139,6 +156,7 @@
372        <?php endif; // if different categories queried ?>
373 <?php endwhile; ?>
374
375+<?php /* Display navigation to next/previous pages when applicable  */ ?>
376 <?php if (  $wp_query->max_num_pages > 1 ) : ?>
377                                <div id="nav-below" class="navigation">
378                                        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
379Index: wp-content/themes/twentyten/onecolumn-page.php
380===================================================================
381--- wp-content/themes/twentyten/onecolumn-page.php      (revision 13836)
382+++ wp-content/themes/twentyten/onecolumn-page.php      (working copy)
383@@ -1,5 +1,14 @@
384-
385 <?php
386+/**
387+ * A custom page template that doesn't use the sidebar
388+ *
389+ * A single column page template that can be selected from
390+ * the dropdown menu on the edit page screen.
391+ *
392+ * @package twenty-ten
393+ */
394+?>
395+<?php
396 /*
397 Template Name: One column, no sidebar
398 Description: A template with no sidebar
399Index: wp-content/themes/twentyten/sidebar.php
400===================================================================
401--- wp-content/themes/twentyten/sidebar.php     (revision 13836)
402+++ wp-content/themes/twentyten/sidebar.php     (working copy)
403@@ -1,3 +1,10 @@
404+<?php
405+/**
406+ * The Sidebar containing the primary and secondary widget areas
407+ *
408+ * @package twenty-ten
409+ */
410+?>
411                <div id="primary" class="widget-area">
412                        <ul class="xoxo">
413 <?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : // begin primary widget area ?>
414Index: wp-content/themes/twentyten/tag.php
415===================================================================
416--- wp-content/themes/twentyten/tag.php (revision 13836)
417+++ wp-content/themes/twentyten/tag.php (working copy)
418@@ -1,3 +1,10 @@
419+<?php
420+/**
421+ * The template used to display Tag Archive pages
422+ *
423+ * @package twenty-ten
424+ */
425+?>
426 <?php get_header(); ?>
427
428                <div id="container">
429Index: wp-content/themes/twentyten/page.php
430===================================================================
431--- wp-content/themes/twentyten/page.php        (revision 13836)
432+++ wp-content/themes/twentyten/page.php        (working copy)
433@@ -1,3 +1,15 @@
434+<?php
435+/**
436+ * The template used to display all pages
437+ *
438+ * This is the template that displays all pages by default.
439+ * Please note that this is the wordpress construct of pages
440+ * and that other 'pages' on your wordpress site will use a
441+ * different template.
442+ *
443+ * @package twenty-ten
444+ */
445+?>
446 <?php get_header(); ?>
447
448                <div id="container">
449Index: wp-content/themes/twentyten/category.php
450===================================================================
451--- wp-content/themes/twentyten/category.php    (revision 13836)
452+++ wp-content/themes/twentyten/category.php    (working copy)
453@@ -1,3 +1,10 @@
454+<?php
455+/**
456+ * The template used to display Catagory Archive pages
457+ *
458+ * @package twenty-ten
459+ */
460+?>
461 <?php get_header(); ?>
462
463                <div id="container">
464Index: wp-content/themes/twentyten/archive.php
465===================================================================
466--- wp-content/themes/twentyten/archive.php     (revision 13836)
467+++ wp-content/themes/twentyten/archive.php     (working copy)
468@@ -1,3 +1,10 @@
469+<?php
470+/**
471+ * The template used in all date based archive pages
472+ *
473+ * @package twenty-ten
474+ */
475+?>
476 <?php get_header(); ?>
477
478                <div id="container">
479Index: wp-content/themes/twentyten/single.php
480===================================================================
481--- wp-content/themes/twentyten/single.php      (revision 13836)
482+++ wp-content/themes/twentyten/single.php      (working copy)
483@@ -1,3 +1,10 @@
484+<?php
485+/**
486+ * The Template used to display all single posts
487+ *
488+ * @package twenty-ten
489+ */
490+?>
491 <?php get_header(); ?>
492
493                <div id="container">
494Index: wp-content/themes/twentyten/comments.php
495===================================================================
496--- wp-content/themes/twentyten/comments.php    (revision 13836)
497+++ wp-content/themes/twentyten/comments.php    (working copy)
498@@ -1,3 +1,15 @@
499+<?php
500+/**
501+ * The template used to display Comments
502+ *
503+ * The area of the page that contains both current comments
504+ * and the comment form.  The actual display of comments is
505+ * handled by a callback to twentyten_comment which is
506+ * located in the functions.php file
507+ *
508+ * @package twenty-ten
509+ */
510+?>
511                        <div id="comments">
512 <?php if ( post_password_required() ) : ?>
513                                <div class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></div>
514Index: wp-content/themes/twentyten/header.php
515===================================================================
516--- wp-content/themes/twentyten/header.php      (revision 13836)
517+++ wp-content/themes/twentyten/header.php      (working copy)
518@@ -1,3 +1,12 @@
519+<?php
520+/**
521+ * The Header for our theme.
522+ *
523+ * Displays all of the <head> section and everything up till <div id="main">
524+ *
525+ * @package twenty-ten
526+ */
527+?>
528 <!DOCTYPE html>
529 <html <?php language_attributes(); ?>>
530 <head>
531@@ -3,4 +12,5 @@
532        <meta charset="<?php bloginfo( 'charset' ); ?>" />
533     <title><?php
534+       // Returns the title based on the type of page being viewed
535         if ( is_single() ) {
536                        single_post_title(); echo ' | '; bloginfo( 'name' );
537@@ -37,9 +47,9 @@
538                                        // Retrieve the dimensions of the current post thumbnail -- no teensy header images for us!
539                                        $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail');
540                                        list($src, $width, $height) = $image;
541-
542+
543                                        // Check if this is a post or page, if it has a thumbnail, and if it's a big one
544-                                       if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) :
545+                                       if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) :
546                                                // Houston, we have a new header image!
547                                                echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
548                                        else : ?>
549Index: wp-content/themes/twentyten/attachment.php
550===================================================================
551--- wp-content/themes/twentyten/attachment.php  (revision 13836)
552+++ wp-content/themes/twentyten/attachment.php  (working copy)
553@@ -1,3 +1,10 @@
554+<?php
555+/**
556+ * The template used to display Attachment type pages
557+ *
558+ * @package twenty-ten
559+ */
560+?>
561 <?php get_header(); ?>
562
563                <div id="container">