Make WordPress Core

Ticket #25256: twentyeleven.diff

File twentyeleven.diff, 48.1 KB (added by DrewAPicture, 12 years ago)
  • src/wp-content/themes/twentyeleven/404.php

     
    11<?php
    22/**
    3  * The template for displaying 404 pages (Not Found).
     3 * Template for displaying 404 pages (Not Found)
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/archive.php

     
    11<?php
    22/**
    3  * The template for displaying Archive pages.
     3 * Template for displaying Archive pages
    44 *
    55 * Used to display archive-type pages if nothing more specific matches a query.
    66 * For example, puts together date-based pages if no date.php file exists.
    77 *
    8  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     8 * @link http://codex.wordpress.org/Template_Hierarchy
    99 *
    1010 * @package WordPress
    1111 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/author.php

     
    11<?php
    22/**
    3  * The template for displaying Author Archive pages.
     3 * Template for displaying Author Archive pages
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
     
    1515                        <?php if ( have_posts() ) : ?>
    1616
    1717                                <?php
    18                                         /* Queue the first post, that way we know
    19                                          * what author we're dealing with (if that is the case).
     18                                        /**
     19                                         * Queue the first post, that way we know what author
     20                                         * we're dealing with (if that is the case).
    2021                                         *
    21                                          * We reset this later so we can run the loop
    22                                          * properly with a call to rewind_posts().
     22                                         * We reset this later so we can run the loop properly
     23                                         * with a call to rewind_posts().
    2324                                         */
    2425                                        the_post();
    2526                                ?>
     
    2930                                </header>
    3031
    3132                                <?php
    32                                         /* Since we called the_post() above, we need to
     33                                        /**
     34                                         * Since we called the_post() above, we need to
    3335                                         * rewind the loop back to the beginning that way
    3436                                         * we can run the loop properly, in full.
    3537                                         */
     
    4345                                if ( get_the_author_meta( 'description' ) ) : ?>
    4446                                <div id="author-info">
    4547                                        <div id="author-avatar">
    46                                                 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?>
     48                                                <?php
     49                                                /**
     50                                                 * Filter the Twenty Eleven author bio avatar size.
     51                                                 *
     52                                                 * @since Twenty Eleven 1.0
     53                                                 *
     54                                                 * @param int The height and width avatar dimension in pixels. Default 60.
     55                                                 */
     56                                                echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) );
     57                                                ?>
    4758                                        </div><!-- #author-avatar -->
    4859                                        <div id="author-description">
    4960                                                <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
     
    5667                                <?php while ( have_posts() ) : the_post(); ?>
    5768
    5869                                        <?php
    59                                                 /* Include the Post-Format-specific template for the content.
     70                                                /**
     71                                                 * Include the Post-Format-specific template for the content.
    6072                                                 * If you want to overload this in a child theme then include a file
    6173                                                 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    6274                                                 */
  • src/wp-content/themes/twentyeleven/category.php

     
    11<?php
    22/**
    3  * The template for displaying Category Archive pages.
     3 * Template for displaying Category Archive pages
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
     
    2121
    2222                                        <?php
    2323                                                $category_description = category_description();
    24                                                 if ( ! empty( $category_description ) )
     24                                                if ( ! empty( $category_description ) ) {
     25                                                        /**
     26                                                         * Filter the default Twenty Eleven category description.
     27                                                         *
     28                                                         * @since Twenty Eleven 1.0
     29                                                         *
     30                                                         * @param string The default category description HTML.
     31                                                         */
    2532                                                        echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
     33                                                }
    2634                                        ?>
    2735                                </header>
    2836
     
    3240                                <?php while ( have_posts() ) : the_post(); ?>
    3341
    3442                                        <?php
    35                                                 /* Include the Post-Format-specific template for the content.
     43                                                /**
     44                                                 * Include the Post-Format-specific template for the content.
    3645                                                 * If you want to overload this in a child theme then include a file
    3746                                                 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    3847                                                 */
  • src/wp-content/themes/twentyeleven/comments.php

     
    11<?php
    22/**
    3  * The template for displaying Comments.
     3 * Template for displaying Comments
    44 *
    55 * The area of the page that contains both current comments
    66 * and the comment form. The actual display of comments is
     
    1717                <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>
    1818        </div><!-- #comments -->
    1919        <?php
    20                         /* Stop the rest of comments.php from being processed,
     20                        /**
     21                         * Stop the rest of comments.php from being processed,
    2122                         * but don't kill the script entirely -- we still have
    2223                         * to fully load the template.
    2324                         */
     
    4546
    4647                <ol class="commentlist">
    4748                        <?php
    48                                 /* Loop through and list the comments. Tell wp_list_comments()
     49                                /**
     50                                 * Loop through and list the comments. Tell wp_list_comments()
    4951                                 * to use twentyeleven_comment() to format the comments.
    5052                                 * If you want to overload this in a child theme then you can
    5153                                 * define twentyeleven_comment() and that will be used instead.
     
    6466                <?php endif; // check for comment navigation ?>
    6567
    6668                <?php
    67                 /* If there are no comments and comments are closed, let's leave a little note, shall we?
     69                /**
     70                 * If there are no comments and comments are closed, let's leave a little note, shall we?
    6871                 * But we only want the note on posts and pages that had comments in the first place.
    6972                 */
    7073                if ( ! comments_open() && get_comments_number() ) : ?>
  • src/wp-content/themes/twentyeleven/content-aside.php

     
    11<?php
    22/**
    3  * The template for displaying posts in the Aside Post Format on index and archive pages
     3 * Template for displaying posts in the Aside Post Format
    44 *
    5  * Learn more: http://codex.wordpress.org/Post_Formats
     5 * Used on index and archive pages.
    66 *
     7 * @link http://codex.wordpress.org/Post_Formats
     8 *
    79 * @package WordPress
    810 * @subpackage Twenty_Eleven
    911 * @since Twenty Eleven 1.0
  • src/wp-content/themes/twentyeleven/content-featured.php

     
    11<?php
    22/**
    3  * The template for displaying content featured in the showcase.php page template
     3 * Template for displaying content featured in the showcase.php page template
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/content-gallery.php

     
    11<?php
    22/**
    3  * The template for displaying posts in the Gallery Post Format on index and archive pages
     3 * Template for displaying posts in the Gallery Post Format
    44 *
    5  * Learn more: http://codex.wordpress.org/Post_Formats
     5 * Used on index and archive pages.
    66 *
     7 * @link http://codex.wordpress.org/Post_Formats
     8 *
    79 * @package WordPress
    810 * @subpackage Twenty_Eleven
    911 * @since Twenty Eleven 1.0
  • src/wp-content/themes/twentyeleven/content-image.php

     
    11<?php
    22/**
    3  * The template for displaying posts in the Image Post Format on index and archive pages
     3 * Template for displaying posts in the Image Post Format
    44 *
    5  * Learn more: http://codex.wordpress.org/Post_Formats
     5 * Used on index and archive pages.
    66 *
     7 * @link http://codex.wordpress.org/Post_Formats
     8 *
    79 * @package WordPress
    810 * @subpackage Twenty_Eleven
    911 * @since Twenty Eleven 1.0
  • src/wp-content/themes/twentyeleven/content-intro.php

     
    11<?php
    22/**
    3  * The template for displaying page content in the showcase.php page template
     3 * Template for displaying page content in the showcase.php page template
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/content-link.php

     
    11<?php
    22/**
    3  * The template for displaying posts in the Link Post Format on index and archive pages
     3 * Template for displaying posts in the Link Post Format
    44 *
    5  * Learn more: http://codex.wordpress.org/Post_Formats
     5 * Used on index and archive pages
    66 *
     7 * @link http://codex.wordpress.org/Post_Formats
     8 *
    79 * @package WordPress
    810 * @subpackage Twenty_Eleven
    911 * @since Twenty Eleven 1.0
  • src/wp-content/themes/twentyeleven/content-page.php

     
    11<?php
    22/**
    3  * The template used for displaying page content in page.php
     3 * Template used for displaying page content in page.php
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/content-quote.php

     
    11<?php
    22/**
    3  * The default template for displaying content
     3 * Template for displaying content
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/content-single.php

     
    5454                <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
    5555                <div id="author-info">
    5656                        <div id="author-avatar">
    57                                 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?>
     57                                <?php
     58                                //duplicate_hook
     59                                echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) );
     60                                ?>
    5861                        </div><!-- #author-avatar -->
    5962                        <div id="author-description">
    6063                                <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
  • src/wp-content/themes/twentyeleven/content-status.php

     
    11<?php
    22/**
    3  * The template for displaying posts in the Status Post Format on index and archive pages
     3 * Template for displaying posts in the Status Post Format
    44 *
    5  * Learn more: http://codex.wordpress.org/Post_Formats
     5 * Used on index and archive pages
    66 *
     7 * @link http://codex.wordpress.org/Post_Formats
     8 *
    79 * @package WordPress
    810 * @subpackage Twenty_Eleven
     11 * @since Twenty Eleven 1.0
    912 */
    1013?>
    1114
     
    2932                </div><!-- .entry-summary -->
    3033                <?php else : ?>
    3134                <div class="entry-content">
    32                         <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
     35                        <div class="avatar">
     36                                <?php
     37                                /**
     38                                 * Filter the Twenty Eleven status avatar size.
     39                                 *
     40                                 * @since Twenty Eleven 1.0
     41                                 *
     42                                 * @param int The height and width avatar dimensions in pixels. Default 65.
     43                                 */
     44                                echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', 65 ) );
     45                                ?>
     46                        </div>
    3347
    3448                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    3549                        <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
  • src/wp-content/themes/twentyeleven/content.php

     
    11<?php
    22/**
    3  * The default template for displaying content
     3 * Template for displaying content
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/footer.php

     
    11<?php
    22/**
    3  * The template for displaying the footer.
     3 * Template for displaying the footer
    44 *
    55 * Contains the closing of the id=main div and all content after
    66 *
     
    1515        <footer id="colophon" role="contentinfo">
    1616
    1717                        <?php
    18                                 /* A sidebar in the footer? Yep. You can can customize
     18                                /**
     19                                 * A sidebar in the footer? Yep. You can can customize
    1920                                 * your footer with three columns of widgets.
    2021                                 */
    2122                                if ( ! is_404() )
  • src/wp-content/themes/twentyeleven/functions.php

     
    5151
    5252if ( ! function_exists( 'twentyeleven_setup' ) ):
    5353/**
    54  * Sets up theme defaults and registers support for various WordPress features.
     54 * Set up theme defaults and registers support for various WordPress features.
    5555 *
    5656 * Note that this function is hooked into the after_setup_theme hook, which runs
    5757 * before the init hook. The init hook is too late for some features, such as indicating
     
    6060 * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's
    6161 * functions.php file.
    6262 *
    63  * @uses load_theme_textdomain() For translation/localization support.
    64  * @uses add_editor_style() To style the visual editor.
    65  * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers
    66  *      and backgrounds, and post formats.
    67  * @uses register_nav_menus() To add support for navigation menus.
     63 * @uses load_theme_textdomain()    For translation/localization support.
     64 * @uses add_editor_style()         To style the visual editor.
     65 * @uses add_theme_support()        To add support for post thumbnails, automatic feed links, custom headers
     66 *                                      and backgrounds, and post formats.
     67 * @uses register_nav_menus()       To add support for navigation menus.
    6868 * @uses register_default_headers() To register the default custom header images provided with the theme.
    69  * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
     69 * @uses set_post_thumbnail_size()  To set a custom post thumbnail size.
    7070 *
    7171 * @since Twenty Eleven 1.0
    7272 */
    7373function twentyeleven_setup() {
    7474
    75         /* Make Twenty Eleven available for translation.
     75        /**
     76         * Make Twenty Eleven available for translation.
    7677         * Translations can be added to the /languages/ directory.
    77          * If you're building a theme based on Twenty Eleven, use a find and replace
    78          * to change 'twentyeleven' to the name of your theme in all the template files.
     78         * If you're building a theme based on Twenty Eleven, use
     79         * a find and replace to change 'twentyeleven' to the name
     80         * of your theme in all the template files.
    7981         */
    8082        load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' );
    8183
     
    105107
    106108        // Add support for custom backgrounds.
    107109        add_theme_support( 'custom-background', array(
    108                 // Let WordPress know what our default background color is.
    109                 // This is dependent on our current color scheme.
     110                /**
     111                 * Let WordPress know what our default background color is.
     112                 * This is dependent on our current color scheme.
     113                 */
    110114                'default-color' => $default_background_color,
    111115        ) );
    112116
     
    118122                // The default header text color.
    119123                'default-text-color' => '000',
    120124                // The height and width of our custom header.
     125                /**
     126                 * Filter the Twenty Eleven default header image width.
     127                 *
     128                 * @since Twenty Eleven 1.0
     129                 *
     130                 * @param int The default header image width in pixels. Default 1000.
     131                 */
    121132                'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ),
     133                /**
     134                 * Filter the Twenty Eleven default header image height.
     135                 *
     136                 * @since Twenty Eleven 1.0
     137                 *
     138                 * @param int The default header image height in pixels. Default 288.
     139                 */
    122140                'height' => apply_filters( 'twentyeleven_header_image_height', 288 ),
    123141                // Support flexible heights.
    124142                'flex-height' => true,
     
    144162                add_custom_background();
    145163        }
    146164
    147         // We'll be using post thumbnails for custom header images on posts and pages.
    148         // We want them to be the size of the header image that we just defined
    149         // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     165        /**
     166         * We'll be using post thumbnails for custom header images on posts and pages.
     167         * We want them to be the size of the header image that we just defined.
     168         * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     169         */
    150170        set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
    151171
    152         // Add Twenty Eleven's custom image sizes.
    153         // Used for large feature (header) images.
     172        /**
     173         * Add Twenty Eleven's custom image sizes.
     174         * Used for large feature (header) images.
     175         */
    154176        add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true );
    155177        // Used for featured posts if a large-feature doesn't exist.
    156178        add_image_size( 'small-feature', 500, 300 );
     
    211233
    212234if ( ! function_exists( 'twentyeleven_header_style' ) ) :
    213235/**
    214  * Styles the header image and text displayed on the blog
     236 * Styles the header image and text displayed on the blog.
    215237 *
    216238 * @since Twenty Eleven 1.0
    217239 */
     
    327349endif; // twentyeleven_admin_header_image
    328350
    329351/**
    330  * Sets the post excerpt length to 40 words.
     352 * Set the post excerpt length to 40 words.
    331353 *
    332  * To override this length in a child theme, remove the filter and add your own
    333  * function tied to the excerpt_length filter hook.
     354 * To override this length in a child theme, remove
     355 * the filter and add your own function tied to
     356 * the excerpt_length filter hook.
     357 *
     358 * @since Twenty Eleven 1.0
     359 *
     360 * @param int $length The number of excerpt characters.
     361 * @return int The filtered number of characters.
    334362 */
    335363function twentyeleven_excerpt_length( $length ) {
    336364        return 40;
     
    339367
    340368if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) :
    341369/**
    342  * Returns a "Continue Reading" link for excerpts
     370 * Return a "Continue Reading" link for excerpts
     371 *
     372 * @since Twenty Eleven 1.0
     373 *
     374 * @return string The "Continue Reading" HTML link.
    343375 */
    344376function twentyeleven_continue_reading_link() {
    345377        return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>';
     
    347379endif; // twentyeleven_continue_reading_link
    348380
    349381/**
    350  * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link().
     382 * Replace "[...]" in the Read More link with an ellipsis.
    351383 *
     384 * The "[...]" is appended to automatically generated excerpts.
     385 *
    352386 * To override this in a child theme, remove the filter and add your own
    353387 * function tied to the excerpt_more filter hook.
     388 *
     389 * @since Twenty Eleven 1.0
     390 *
     391 * @param string $more The Read More text.
     392 * @return The filtered Read More text.
    354393 */
    355394function twentyeleven_auto_excerpt_more( $more ) {
    356395        return ' &hellip;' . twentyeleven_continue_reading_link();
     
    358397add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
    359398
    360399/**
    361  * Adds a pretty "Continue Reading" link to custom post excerpts.
     400 * Add a pretty "Continue Reading" link to custom post excerpts.
    362401 *
    363402 * To override this link in a child theme, remove the filter and add your own
    364403 * function tied to the get_the_excerpt filter hook.
     404 *
     405 * @since Twenty Eleven 1.0
     406 *
     407 * @param string $output The "Continue Reading" link.
     408 * @return string The filtered "Continue Reading" link.
    365409 */
    366410function twentyeleven_custom_excerpt_more( $output ) {
    367411        if ( has_excerpt() && ! is_attachment() ) {
     
    372416add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
    373417
    374418/**
    375  * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
     419 * Show a home link for the wp_nav_menu() fallback, wp_page_menu().
     420 *
     421 * @since Twenty Eleven 1.0
     422 *
     423 * @param array $args The page menu arguments. @see wp_page_menu()
     424 * @return array The filtered page menu arguments.
    376425 */
    377426function twentyeleven_page_menu_args( $args ) {
    378427        if ( ! isset( $args['show_home'] ) )
     
    382431add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );
    383432
    384433/**
    385  * Register our sidebars and widgetized areas. Also register the default Epherma widget.
     434 * Register sidebars and widgetized areas.
    386435 *
     436 * Also register the default Epherma widget.
     437 *
    387438 * @since Twenty Eleven 1.0
    388439 */
    389440function twentyeleven_widgets_init() {
     
    443494
    444495if ( ! function_exists( 'twentyeleven_content_nav' ) ) :
    445496/**
    446  * Display navigation to next/previous pages when applicable
     497 * Display navigation to next/previous pages when applicable.
     498 *
     499 * @since Twenty Eleven 1.0
     500 *
     501 * @param string $html_id The HTML id attribute.
    447502 */
    448503function twentyeleven_content_nav( $html_id ) {
    449504        global $wp_query;
     
    462517 * Return the first link from the post content. If none found, the
    463518 * post permalink is used as a fallback.
    464519 *
     520 * @since Twenty Eleven 1.0
     521 *
    465522 * @uses get_url_in_content() to get the first URL from the post content.
    466523 *
    467  * @return string
     524 * @return string The first link.
    468525 */
    469526function twentyeleven_get_first_url() {
    470527        $content = get_the_content();
     
    473530        if ( ! $has_url )
    474531                $has_url = twentyeleven_url_grabber();
    475532
     533        //duplicate_hook
    476534        return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
    477535}
    478536
     
    480538 * Return the URL for the first link found in the post content.
    481539 *
    482540 * @since Twenty Eleven 1.0
     541 *
    483542 * @return string|bool URL or false when no link is present.
    484543 */
    485544function twentyeleven_url_grabber() {
     
    490549}
    491550
    492551/**
    493  * Count the number of footer sidebars to enable dynamic classes for the footer
     552 * Count the number of footer sidebars to enable dynamic classes for the footer.
     553 *
     554 * @since Twenty Eleven 1.0
    494555 */
    495556function twentyeleven_footer_sidebar_class() {
    496557        $count = 0;
     
    532593 * Used as a callback by wp_list_comments() for displaying the comments.
    533594 *
    534595 * @since Twenty Eleven 1.0
     596 *
     597 * @param object $comment The comment object.
     598 * @param array  $args    An array of comment arguments. @see get_comment_reply_link()
     599 * @param int    $depth   The depth of the comment.
    535600 */
    536601function twentyeleven_comment( $comment, $args, $depth ) {
    537602        $GLOBALS['comment'] = $comment;
     
    593658
    594659if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
    595660/**
    596  * Prints HTML with meta information for the current post-date/time and author.
     661 * Print HTML with meta information for the current post-date/time and author.
     662 *
    597663 * Create your own twentyeleven_posted_on to override in a child theme
    598664 *
    599665 * @since Twenty Eleven 1.0
     
    612678endif;
    613679
    614680/**
    615  * Adds two classes to the array of body classes.
     681 * Add two classes to the array of body classes.
     682 *
    616683 * The first is if the site has only had one author with published posts.
    617684 * The second is if a singular post being displayed
    618685 *
    619686 * @since Twenty Eleven 1.0
     687 *
     688 * @param array $classes Existing body classes.
     689 * @return array The filtered array of body classes.
    620690 */
    621691function twentyeleven_body_classes( $classes ) {
    622692
     
    631701add_filter( 'body_class', 'twentyeleven_body_classes' );
    632702
    633703/**
    634  * Retrieves the IDs for images in a gallery.
     704 * Retrieve the IDs for images in a gallery.
    635705 *
    636  * @uses get_post_galleries() first, if available. Falls back to shortcode parsing,
    637  * then as last option uses a get_posts() call.
     706 * @uses get_post_galleries() First, if available. Falls back to shortcode parsing,
     707 *                            then as last option uses a get_posts() call.
    638708 *
    639709 * @since Twenty Eleven 1.6.
    640710 *
  • src/wp-content/themes/twentyeleven/header.php

     
    11<?php
    22/**
    3  * The Header for our theme.
     3 * Header template for the theme
    44 *
    5  * Displays all of the <head> section and everything up till <div id="main">
     5 * Displays all of the <head> section and everything up till <div id="main">.
    66 *
    77 * @package WordPress
    88 * @subpackage Twenty_Eleven
     
    2525<meta charset="<?php bloginfo( 'charset' ); ?>" />
    2626<meta name="viewport" content="width=device-width" />
    2727<title><?php
    28         /*
     28        /**
    2929         * Print the <title> tag based on what is being viewed.
    3030         */
    3131        global $page, $paged;
     
    5252<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
    5353<![endif]-->
    5454<?php
    55         /* We add some JavaScript to pages with the comment form
     55        /**
     56         * We add some JavaScript to pages with the comment form
    5657         * to support sites with threaded comments (when in use).
    5758         */
    5859        if ( is_singular() && get_option( 'thread_comments' ) )
    5960                wp_enqueue_script( 'comment-reply' );
    6061
    61         /* Always have wp_head() just before the closing </head>
     62        /**
     63         * Always have wp_head() just before the closing </head>
    6264         * tag of your theme, or you will break many plugins, which
    6365         * generally use this hook to add elements to <head> such
    6466         * as styles, scripts, and meta tags.
     
    8183                                if ( $header_image ) :
    8284                                        // Compatibility with versions of WordPress prior to 3.4.
    8385                                        if ( function_exists( 'get_custom_header' ) ) {
    84                                                 // We need to figure out what the minimum width should be for our featured image.
    85                                                 // This result would be the suggested width if the theme were to implement flexible widths.
     86                                                /**
     87                                                 * We need to figure out what the minimum width should be for our featured image.
     88                                                 * This result would be the suggested width if the theme were to implement flexible widths.
     89                                                 */
    8690                                                $header_image_width = get_theme_support( 'custom-header', 'width' );
    8791                                        } else {
    8892                                                $header_image_width = HEADER_IMAGE_WIDTH;
     
    9094                                        ?>
    9195                        <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    9296                                <?php
    93                                         // The header image
    94                                         // Check if this is a post or page, if it has a thumbnail, and if it's a big one
     97                                        /**
     98                                         * The header image.
     99                                         * Check if this is a post or page, if it has a thumbnail, and if it's a big one
     100                                         */
    95101                                        if ( is_singular() && has_post_thumbnail( $post->ID ) &&
    96102                                                        ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
    97103                                                        $image[1] >= $header_image_width ) :
  • src/wp-content/themes/twentyeleven/image.php

     
    11<?php
    22/**
    3  * The template for displaying image attachments.
     3 * Template for displaying image attachments
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
     
    7272        }
    7373?>
    7474                                                                        <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
     75                                                                        /**
     76                                                                         * Filter the Twenty Eleven default attachment size.
     77                                                                         *
     78                                                                         * @since Twenty Eleven 1.0
     79                                                                         *
     80                                                                         * @param int The height and width attachment size dimensions in pixels. Default 848.
     81                                                                         */
    7582                                                                        $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
    7683                                                                        echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
    7784                                                                        ?></a>
  • src/wp-content/themes/twentyeleven/inc/theme-options.php

     
    1414 *
    1515 * @since Twenty Eleven 1.0
    1616 *
     17 * @param string $hook_suffix An admin page's hook suffix.
    1718 */
    1819function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
    1920        wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );
     
    5152
    5253        // Register our individual settings fields
    5354        add_settings_field(
    54                 'color_scheme',  // Unique identifier for the field for this section
    55                 __( 'Color Scheme', 'twentyeleven' ), // Setting field label
     55                'color_scheme',                             // Unique identifier for the field for this section
     56                __( 'Color Scheme', 'twentyeleven' ),       // Setting field label
    5657                'twentyeleven_settings_field_color_scheme', // Function that renders the settings field
    57                 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
    58                 'general' // Settings section. Same as the first argument in the add_settings_section() above
     58                'theme_options',                            // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
     59                'general'                                   // Settings section. Same as the first argument in the add_settings_section() above
    5960        );
    6061
    6162        add_settings_field( 'link_color', __( 'Link Color',     'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' );
     
    6667/**
    6768 * Change the capability required to save the 'twentyeleven_options' options group.
    6869 *
    69  * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group.
     70 * @see twentyeleven_theme_options_init()     First parameter to register_setting() is the name of the options group.
    7071 * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page.
    7172 *
    7273 * By default, the options groups for all registered settings require the manage_options capability.
     
    8384add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' );
    8485
    8586/**
    86  * Add our theme options page to the admin menu, including some help documentation.
     87 * Add a theme options page to the admin menu, including some help documentation.
    8788 *
    8889 * This function is attached to the admin_menu action hook.
    8990 *
     
    122123        $screen = get_current_screen();
    123124
    124125        if ( method_exists( $screen, 'add_help_tab' ) ) {
    125                 // WordPress 3.3
     126                // WordPress 3.3.0
    126127                $screen->add_help_tab( array(
    127128                        'title' => __( 'Overview', 'twentyeleven' ),
    128129                        'id' => 'theme-options-help',
     
    132133
    133134                $screen->set_help_sidebar( $sidebar );
    134135        } else {
    135                 // WordPress 3.2
     136                // WordPress 3.2.0
    136137                add_contextual_help( $screen, $help . $sidebar );
    137138        }
    138139}
    139140
    140141/**
    141  * Returns an array of color schemes registered for Twenty Eleven.
     142 * Return an array of color schemes registered for Twenty Eleven.
    142143 *
    143144 * @since Twenty Eleven 1.0
    144145 */
     
    158159                ),
    159160        );
    160161
     162        /**
     163         * Filter the Twenty Eleven color scheme options.
     164         *
     165         * @since Twenty Eleven 1.0
     166         *
     167         * @param array $color_scheme_options An associative array of color scheme options.
     168         */
    161169        return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options );
    162170}
    163171
    164172/**
    165  * Returns an array of layout options registered for Twenty Eleven.
     173 * Return an array of layout options registered for Twenty Eleven.
    166174 *
    167175 * @since Twenty Eleven 1.0
    168176 */
     
    185193                ),
    186194        );
    187195
     196        /**
     197         * Filter the Twenty Eleven layout options.
     198         *
     199         * @since Twenty Eleven 1.0
     200         *
     201         * @param array $layout_options An associative array of layout options.
     202         */
    188203        return apply_filters( 'twentyeleven_layouts', $layout_options );
    189204}
    190205
    191206/**
    192  * Returns the default options for Twenty Eleven.
     207 * Return the default options for Twenty Eleven.
    193208 *
    194209 * @since Twenty Eleven 1.0
     210 *
     211 * @return array An array of default theme options.
    195212 */
    196213function twentyeleven_get_default_theme_options() {
    197214        $default_theme_options = array(
     
    203220        if ( is_rtl() )
    204221                $default_theme_options['theme_layout'] = 'sidebar-content';
    205222
     223        /**
     224         * Filter the Twenty Eleven default options.
     225         *
     226         * @since Twenty Eleven 1.0
     227         *
     228         * @param array $default_theme_options An array of default theme options.
     229         */
    206230        return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options );
    207231}
    208232
    209233/**
    210  * Returns the default link color for Twenty Eleven, based on color scheme.
     234 * Return the default link color for Twenty Eleven, based on color scheme.
    211235 *
    212236 * @since Twenty Eleven 1.0
    213237 *
    214  * @param $string $color_scheme Color scheme. Defaults to the active color scheme.
    215  * @return $string Color.
     238 * @param string $color_scheme Optional. Color scheme.
     239 *                             Default null (or the active color scheme).
     240 * @return string The default link color.
    216241*/
    217242function twentyeleven_get_default_link_color( $color_scheme = null ) {
    218243        if ( null === $color_scheme ) {
     
    228253}
    229254
    230255/**
    231  * Returns the options array for Twenty Eleven.
     256 * Return the options array for Twenty Eleven.
    232257 *
    233258 * @since Twenty Eleven 1.0
    234259 */
     
    237262}
    238263
    239264/**
    240  * Renders the Color Scheme setting field.
     265 * Render the Color Scheme setting field.
    241266 *
    242267 * @since Twenty Eleven 1.3
    243268 */
     
    261286}
    262287
    263288/**
    264  * Renders the Link Color setting field.
     289 * Render the Link Color setting field.
    265290 *
    266291 * @since Twenty Eleven 1.3
    267292 */
     
    278303}
    279304
    280305/**
    281  * Renders the Layout setting field.
     306 * Render the Layout setting field.
    282307 *
    283308 * @since Twenty Eleven 1.3
    284309 */
     
    300325}
    301326
    302327/**
    303  * Returns the options array for Twenty Eleven.
     328 * Return the options array for Twenty Eleven.
    304329 *
    305330 * @since Twenty Eleven 1.2
    306331 */
     
    324349}
    325350
    326351/**
    327  * Sanitize and validate form input. Accepts an array, return a sanitized array.
     352 * Sanitize and validate form input.
    328353 *
     354 * Accepts an array, return a sanitized array.
     355 *
    329356 * @see twentyeleven_theme_options_init()
    330357 * @todo set up Reset Options action
    331358 *
    332359 * @since Twenty Eleven 1.0
     360 *
     361 * @param array $input An array of form input.
    333362 */
    334363function twentyeleven_theme_options_validate( $input ) {
    335364        $output = $defaults = twentyeleven_get_default_theme_options();
     
    349378        if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) )
    350379                $output['theme_layout'] = $input['theme_layout'];
    351380
     381        /**
     382         * Filter the Twenty Eleven sanitized form input array.
     383         *
     384         * @since Twenty Eleven 1.0
     385         *
     386         * @param array $output   An array of sanitized form output.
     387         * @param array $input    An array of un-sanitized form input.
     388         * @param array $defaults An array of default theme options.
     389         */
    352390        return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults );
    353391}
    354392
     
    364402        if ( 'dark' == $color_scheme )
    365403                wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
    366404
     405        /**
     406         * Fires after the styles for the Twenty Eleven color scheme are enqueued.
     407         *
     408         * @since Twenty Eleven 1.0
     409         *
     410         * @param string $color_scheme The color scheme.
     411         */
    367412        do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme );
    368413}
    369414add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' );
     
    417462add_action( 'wp_head', 'twentyeleven_print_link_color_style' );
    418463
    419464/**
    420  * Adds Twenty Eleven layout classes to the array of body classes.
     465 * Add Twenty Eleven layout classes to the array of body classes.
    421466 *
    422467 * @since Twenty Eleven 1.0
     468 *
     469 * @param array $existing_classes An array of existing body classes.
    423470 */
    424471function twentyeleven_layout_classes( $existing_classes ) {
    425472        $options = twentyeleven_get_theme_options();
     
    437484        else
    438485                $classes[] = $current_layout;
    439486
     487        /**
     488         * Filter the Twenty Eleven layout body classes.
     489         *
     490         * @since Twenty Eleven 1.0
     491         *
     492         * @param array  $classes        An array of body classes.
     493         * @param string $current_layout The current theme layout.
     494         */
    440495        $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
    441496
    442497        return array_merge( $existing_classes, $classes );
     
    446501/**
    447502 * Implements Twenty Eleven theme options into Theme Customizer
    448503 *
    449  * @param $wp_customize Theme Customizer object
     504 * @since Twenty Eleven 1.3
     505 *
     506 * @param object $wp_customize Theme Customizer object.
    450507 * @return void
    451508 *
    452  * @since Twenty Eleven 1.3
    453509 */
    454510function twentyeleven_customize_register( $wp_customize ) {
    455511        $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
     
    521577
    522578/**
    523579 * Bind JS handlers to make Theme Customizer preview reload changes asynchronously.
     580 *
    524581 * Used with blogname and blogdescription.
    525582 *
    526583 * @since Twenty Eleven 1.3
  • src/wp-content/themes/twentyeleven/inc/widgets.php

     
    11<?php
    22/**
    3  * Makes a custom Widget for displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven
     3 * Widget For displaying post format posts
    44 *
    5  * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets
     5 * Handles displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven.
    66 *
     7 * @link http://codex.wordpress.org/Widgets_API#Developing_Widgets
     8 *
    79 * @package WordPress
    810 * @subpackage Twenty_Eleven
    911 * @since Twenty Eleven 1.0
     
    1315        /**
    1416         * Constructor
    1517         *
     18         * @since Twenty Eleven 1.0
     19         *
    1620         * @return void
    1721         **/
    1822        function Twenty_Eleven_Ephemera_Widget() {
     
    2832        /**
    2933         * Outputs the HTML for this widget.
    3034         *
    31          * @param array An array of standard parameters for widgets in this theme
    32          * @param array An array of settings for this widget instance
    33          * @return void Echoes its output
     35         * @since Twenty Eleven 1.0
     36         *
     37         * @param array $args     An array of standard parameters for widgets in this theme.
     38         * @param array $instance An array of settings for this widget instance.
     39         * @return void
    3440         **/
    3541        function widget( $args, $instance ) {
    3642                $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
     
    4955                ob_start();
    5056                extract( $args, EXTR_SKIP );
    5157
     58                //duplicate_hook
    5259                $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base);
    5360
    5461                if ( ! isset( $instance['number'] ) )
     
    120127        }
    121128
    122129        /**
     130         * Update widget settings.
     131         *
    123132         * Deals with the settings when they are saved by the admin. Here is
    124133         * where any validation should be dealt with.
     134         *
     135         * @since Twenty Eleven 1.0
    125136         **/
    126137        function update( $new_instance, $old_instance ) {
    127138                $instance = $old_instance;
     
    136147                return $instance;
    137148        }
    138149
     150        /**
     151         * Flush widget cache.
     152         *
     153         * @since Twenty Eleven 1.0
     154         */
    139155        function flush_widget_cache() {
    140156                wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' );
    141157        }
    142158
    143159        /**
     160         * Set up the widget form.
     161         *
    144162         * Displays the form for this widget on the Widgets page of the WP Admin area.
     163         *
     164         * @since Twenty Eleven 1.0
    145165         **/
    146166        function form( $instance ) {
    147167                $title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : '';
  • src/wp-content/themes/twentyeleven/index.php

     
    11<?php
    22/**
    3  * The main template file.
     3 * Main template file
    44 *
    55 * This is the most generic template file in a WordPress theme
    66 * and one of the two required files for a theme (the other being style.css).
  • src/wp-content/themes/twentyeleven/page.php

     
    11<?php
    22/**
    3  * The template for displaying all pages.
     3 * Template for displaying all pages
    44 *
    55 * This is the template that displays all pages by default.
    66 * Please note that this is the WordPress construct of pages
  • src/wp-content/themes/twentyeleven/search.php

     
    11<?php
    22/**
    3  * The template for displaying Search Results pages.
     3 * Template for displaying Search Results pages
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
     
    2424                                <?php while ( have_posts() ) : the_post(); ?>
    2525
    2626                                        <?php
    27                                                 /* Include the Post-Format-specific template for the content.
     27                                                /**
     28                                                 * Include the Post-Format-specific template for the content.
    2829                                                 * If you want to overload this in a child theme then include a file
    29                                                  * called content-___.php (where ___ is the Post Format name) and that will be used instead.
     30                                                 * called content-___.php (where ___ is the Post Format name) and that
     31                                                 * will be used instead.
    3032                                                 */
    3133                                                get_template_part( 'content', get_post_format() );
    3234                                        ?>
  • src/wp-content/themes/twentyeleven/searchform.php

     
    11<?php
    22/**
    3  * The template for displaying search forms in Twenty Eleven
     3 * Template for displaying search forms in Twenty Eleven
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/showcase.php

     
    11<?php
    22/**
    33 * Template Name: Showcase Template
    4  * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts
    54 *
     5 * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts.
     6 *
    67 * The showcase template in Twenty Eleven consists of a featured posts section using sticky posts,
    78 * another recent posts area (with the latest post shown in full and the rest as a list)
    89 * and a left sidebar holding aside posts.
  • src/wp-content/themes/twentyeleven/sidebar-footer.php

     
    11<?php
    22/**
    3  * The Footer widget areas.
     3 * Footer widget areas
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
     
    99?>
    1010
    1111<?php
    12         /* The footer widget area is triggered if any of the areas
     12        /**
     13         * The footer widget area is triggered if any of the areas
    1314         * have widgets. So let's check that first.
    1415         *
    1516         * If none of the sidebars have widgets, then let's bail early.
  • src/wp-content/themes/twentyeleven/sidebar-page.php

     
    11<?php
    22/**
    33 * Template Name: Sidebar Template
    4  * Description: A Page Template that adds a sidebar to pages
    54 *
     5 * Description: A Page Template that adds a sidebar to pages.
     6 *
    67 * @package WordPress
    78 * @subpackage Twenty_Eleven
    89 * @since Twenty Eleven 1.0
  • src/wp-content/themes/twentyeleven/sidebar.php

     
    11<?php
    22/**
    3  * The Sidebar containing the main widget area.
     3 * Sidebar containing the main widget area
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/single.php

     
    11<?php
    22/**
    3  * The Template for displaying all single posts.
     3 * Template for displaying all single posts
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
  • src/wp-content/themes/twentyeleven/tag.php

     
    11<?php
    22/**
    3  * The template used to display Tag Archive pages
     3 * Template used to display Tag Archive pages
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Eleven
     
    2121
    2222                                        <?php
    2323                                                $tag_description = tag_description();
    24                                                 if ( ! empty( $tag_description ) )
     24                                                if ( ! empty( $tag_description ) ) {
     25                                                        /**
     26                                                         * Filter the default Twenty Eleven tag description.
     27                                                         *
     28                                                         * @since Twenty Eleven 1.0
     29                                                         *
     30                                                         * @param string The default tag description.
     31                                                         */
    2532                                                        echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
     33                                                }
    2634                                        ?>
    2735                                </header>
    2836
     
    3240                                <?php while ( have_posts() ) : the_post(); ?>
    3341
    3442                                        <?php
    35                                                 /* Include the Post-Format-specific template for the content.
     43                                                /**
     44                                                 * Include the Post-Format-specific template for the content.
    3645                                                 * If you want to overload this in a child theme then include a file
    37                                                  * called content-___.php (where ___ is the Post Format name) and that will be used instead.
     46                                                 * called content-___.php (where ___ is the Post Format name) and that
     47                                                 * will be used instead.
    3848                                                 */
    3949                                                get_template_part( 'content', get_post_format() );
    4050                                        ?>