Make WordPress Core

Ticket #25256: twentytwelve.diff

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

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

     
    11<?php
    22/**
    3  * The template for displaying Archive pages.
     3 * The 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.
     
    1010 * has tag.php for Tag archives, category.php for Category archives, and
    1111 * author.php for Author archives.
    1212 *
    13  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     13 * @link http://codex.wordpress.org/Template_Hierarchy
    1414 *
    1515 * @package WordPress
    1616 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/author.php

     
    11<?php
    22/**
    3  * The template for displaying Author Archive pages.
     3 * The template for displaying Author Archive pages
    44 *
    55 * Used to display archive-type pages for posts by an author.
    66 *
    7  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     7 * @link http://codex.wordpress.org/Template_Hierarchy
    88 *
    99 * @package WordPress
    1010 * @subpackage Twenty_Twelve
     
    4747                        if ( get_the_author_meta( 'description' ) ) : ?>
    4848                        <div class="author-info">
    4949                                <div class="author-avatar">
    50                                         <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 60 ) ); ?>
     50                                        <?php
     51                                        //duplicate_hook
     52                                        $author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 60 );
     53                                        echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
     54                                        ?>
    5155                                </div><!-- .author-avatar -->
    5256                                <div class="author-description">
    5357                                        <h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
  • src/wp-content/themes/twentytwelve/category.php

     
    11<?php
    22/**
    3  * The template for displaying Category pages.
     3 * The template for displaying Category pages
    44 *
    55 * Used to display archive-type pages for posts in a category.
    66 *
    7  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     7 * @link http://codex.wordpress.org/Template_Hierarchy
    88 *
    99 * @package WordPress
    1010 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/comments.php

     
    11<?php
    22/**
    3  * The template for displaying Comments.
     3 * The 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
     
    1212 * @since Twenty Twelve 1.0
    1313 */
    1414
    15 /*
     15/**
    1616 * If the current post is protected by a password and
    1717 * the visitor has not yet entered the password we will
    1818 * return early without loading the comments.
  • src/wp-content/themes/twentytwelve/content-none.php

     
    11<?php
    22/**
    3  * The template for displaying a "No posts found" message.
     3 * The template for displaying a "No posts found" message
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/content-status.php

     
    1414                                <h1><?php the_author(); ?></h1>
    1515                                <h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a></h2>
    1616                        </header>
    17                         <?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentytwelve_status_avatar', '48' ) ); ?>
     17                        <?php
     18                        /**
     19                         * Filter the status avatar size.
     20                         *
     21                         * @since Twenty Twelve 1.0
     22                         *
     23                         * @param int $size The height and width of the avatar in pixels.
     24                         */
     25                        $status_avatar = apply_filters( 'twentytwelve_status_avatar', '48' );
     26                        echo get_avatar( get_the_author_meta( 'ID' ), $status_avatar );
     27                        ?>
    1828                </div><!-- .entry-header -->
    1929
    2030                <div class="entry-content">
  • src/wp-content/themes/twentytwelve/content.php

     
    11<?php
    22/**
    3  * The default template for displaying content. Used for both single and index/archive/search.
     3 * The default template for displaying content
    44 *
     5 * Used for both single and index/archive/search.
     6 *
    57 * @package WordPress
    68 * @subpackage Twenty_Twelve
    79 * @since Twenty Twelve 1.0
     
    4749                        <?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
    4850                                <div class="author-info">
    4951                                        <div class="author-avatar">
    50                                                 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
     52                                                <?php
     53                                                /**
     54                                                 * Filter the author bio avatar size.
     55                                                 *
     56                                                 * @since Twenty Twelve 1.0
     57                                                 *
     58                                                 * @param int $size The height and width of the avatar in pixels.
     59                                                 */
     60                                                $author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 68 );
     61                                                echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
     62                                                ?>
    5163                                        </div><!-- .author-avatar -->
    5264                                        <div class="author-description">
    5365                                                <h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
  • src/wp-content/themes/twentytwelve/footer.php

     
    11<?php
    22/**
    3  * The template for displaying the footer.
     3 * The template for displaying the footer
    44 *
    5  * Contains footer content and the closing of the
    6  * #main and #page div elements.
     5 * Contains footer content and the closing of the #main and #page div elements.
    76 *
    87 * @package WordPress
    98 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/functions.php

     
    11<?php
    22/**
    3  * Twenty Twelve functions and definitions.
     3 * Twenty Twelve functions and definitions
    44 *
    55 * Sets up the theme and provides some helper functions, which are used
    66 * in the theme as custom template tags. Others are attached to action and
     
    1515 * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
    1616 * to a filter or action hook.
    1717 *
    18  * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
     18 * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API
    1919 *
    2020 * @package WordPress
    2121 * @subpackage Twenty_Twelve
     
    2323 */
    2424
    2525/**
    26  * Sets up the content width value based on the theme's design and stylesheet.
     26 * Set up the content width value based on the theme's design and stylesheet.
    2727 */
    2828if ( ! isset( $content_width ) )
    2929        $content_width = 625;
    3030
    3131/**
     32 * Twenty Twelve setup.
     33 *
    3234 * Sets up theme defaults and registers the various WordPress features that
    3335 * Twenty Twelve supports.
    3436 *
     
    4244 * @since Twenty Twelve 1.0
    4345 */
    4446function twentytwelve_setup() {
    45         /*
     47        /**
    4648         * Makes Twenty Twelve available for translation.
    4749         *
    4850         * Translations can be added to the /languages/ directory.
     
    6365        // This theme uses wp_nav_menu() in one location.
    6466        register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
    6567
    66         /*
    67          * This theme supports custom background color and image, and here
    68          * we also set up the default background color.
     68        /**
     69         * This theme supports custom background color and image,
     70         * and here we also set up the default background color.
    6971         */
    7072        add_theme_support( 'custom-background', array(
    7173                'default-color' => 'e6e6e6',
     
    7880add_action( 'after_setup_theme', 'twentytwelve_setup' );
    7981
    8082/**
    81  * Adds support for a custom header image.
     83 * Add support for a custom header image.
    8284 */
    8385require( get_template_directory() . '/inc/custom-header.php' );
    8486
    8587/**
    86  * Returns the Google font stylesheet URL if available.
     88 * Return the Google font stylesheet URL if available.
    8789 *
    8890 * The use of Open Sans by default is localized. For languages that use
    8991 * characters not supported by the font, the font can be disabled.
     
    9597function twentytwelve_get_font_url() {
    9698        $font_url = '';
    9799
    98         /* translators: If there are characters in your language that are not supported
    99          by Open Sans, translate this to 'off'. Do not translate into your own language. */
     100        /**
     101         * translators: If there are characters in your language that are not supported
     102         * by Open Sans, translate this to 'off'. Do not translate into your own language.
     103         */
    100104        if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
    101105                $subsets = 'latin,latin-ext';
    102106
    103                 /* translators: To add an additional Open Sans character subset specific to your language, translate
    104                  this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
     107                /**
     108                 * translators: To add an additional Open Sans character subset specific to your language,
     109                 * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     110                 */
    105111                $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
    106112
    107113                if ( 'cyrillic' == $subset )
     
    123129}
    124130
    125131/**
    126  * Enqueues scripts and styles for front-end.
     132 * Enqueue scripts and styles for front-end.
    127133 *
    128134 * @since Twenty Twelve 1.0
     135 *
     136 * @return void
    129137 */
    130138function twentytwelve_scripts_styles() {
    131139        global $wp_styles;
    132140
    133         /*
     141        /**
    134142         * Adds JavaScript to pages with the comment form to support
    135143         * sites with threaded comments (when in use).
    136144         */
    137145        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    138146                wp_enqueue_script( 'comment-reply' );
    139147
    140         /*
     148        /**
    141149         * Adds JavaScript for handling the navigation menu hide-and-show behavior.
    142150         */
    143151        wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
     
    146154        if ( ! empty( $font_url ) )
    147155                wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
    148156
    149         /*
     157        /**
    150158         * Loads our main stylesheet.
    151159         */
    152160        wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
    153161
    154         /*
     162        /**
    155163         * Loads the Internet Explorer specific stylesheet.
    156164         */
    157165        wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' );
     
    160168add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
    161169
    162170/**
     171 * Filter TinyMCE CSS path to include Google Fonts.
     172 *
    163173 * Adds additional stylesheets to the TinyMCE editor if needed.
    164174 *
    165175 * @uses twentytwelve_get_font_url() To get the Google Font stylesheet URL.
     
    167177 * @since Twenty Twelve 1.2
    168178 *
    169179 * @param string $mce_css CSS path to load in TinyMCE.
    170  * @return string
     180 * @return string Filtered CSS path.
    171181 */
    172182function twentytwelve_mce_css( $mce_css ) {
    173183        $font_url = twentytwelve_get_font_url();
     
    185195add_filter( 'mce_css', 'twentytwelve_mce_css' );
    186196
    187197/**
     198 * Filter the page title.
     199 *
    188200 * Creates a nicely formatted and more specific title element text
    189201 * for output in head of document, based on current view.
    190202 *
     
    217229add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
    218230
    219231/**
     232 * Filter the page menu arguments.
     233 *
    220234 * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
    221235 *
    222236 * @since Twenty Twelve 1.0
     
    229243add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
    230244
    231245/**
     246 * Register sidebars.
     247 *
    232248 * Registers our main widget area and the front page widget areas.
    233249 *
    234250 * @since Twenty Twelve 1.0
     
    297313 * Used as a callback by wp_list_comments() for displaying the comments.
    298314 *
    299315 * @since Twenty Twelve 1.0
     316 *
     317 * @return void
    300318 */
    301319function twentytwelve_comment( $comment, $args, $depth ) {
    302320        $GLOBALS['comment'] = $comment;
     
    353371
    354372if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
    355373/**
     374 * Set up post entry meta.
     375 *
    356376 * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
    357377 *
    358378 * Create your own twentytwelve_entry_meta() to override in a child theme.
    359379 *
    360380 * @since Twenty Twelve 1.0
     381 *
     382 * @return void
    361383 */
    362384function twentytwelve_entry_meta() {
    363385        // Translators: used between list items, there is a space after the comma.
     
    399421endif;
    400422
    401423/**
     424 * Extend the default WordPress body classes.
     425 *
    402426 * Extends the default WordPress body class to denote:
    403427 * 1. Using a full-width layout, when no active widgets in the sidebar
    404428 *    or full-width template.
     
    410434 *
    411435 * @since Twenty Twelve 1.0
    412436 *
    413  * @param array Existing class values.
     437 * @param array $classes Existing class values.
    414438 * @return array Filtered class values.
    415439 */
    416440function twentytwelve_body_class( $classes ) {
     
    447471add_filter( 'body_class', 'twentytwelve_body_class' );
    448472
    449473/**
     474 * Adjust content width in certain contexts.
     475 *
    450476 * Adjusts content_width value for full-width and single image attachment
    451477 * templates, and when there are no active widgets in the sidebar.
    452478 *
    453479 * @since Twenty Twelve 1.0
     480 *
     481 * @return void
    454482 */
    455483function twentytwelve_content_width() {
    456484        if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
     
    461489add_action( 'template_redirect', 'twentytwelve_content_width' );
    462490
    463491/**
     492 * Register postMessage support.
     493 *
    464494 * Add postMessage support for site title and description for the Theme Customizer.
    465495 *
    466496 * @since Twenty Twelve 1.0
     
    476506add_action( 'customize_register', 'twentytwelve_customize_register' );
    477507
    478508/**
     509 * Enqueue Javascript postMessage handlers for the Theme Customizer.
     510 *
    479511 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
    480512 *
    481513 * @since Twenty Twelve 1.0
     514 *
     515 * @return void
    482516 */
    483517function twentytwelve_customize_preview_js() {
    484518        wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130301', true );
  • src/wp-content/themes/twentytwelve/header.php

     
    11<?php
    22/**
    3  * The Header for our theme.
     3 * The Header template for our theme
    44 *
    55 * Displays all of the <head> section and everything up till <div id="main">
    66 *
  • src/wp-content/themes/twentytwelve/image.php

     
    11<?php
    22/**
    3  * The template for displaying image attachments.
     3 * The template for displaying image attachments
    44 *
    5  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     5 * @link http://codex.wordpress.org/Template_Hierarchy
    66 *
    77 * @package WordPress
    88 * @subpackage Twenty_Twelve
     
    7474endif;
    7575?>
    7676                                                                <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
    77                                                                 $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
     77                                                                $size = array( 960, 960 );
     78                                                                /**
     79                                                                 * Filter the image attachment size to use.
     80                                                                 *
     81                                                                 * @since Twenty Twelve 1.0
     82                                                                 *
     83                                                                 * @param array $size {
     84                                                                 *     @type int The attachment height in pixels.
     85                                                                 *     @type int The attachment width in pixels.
     86                                                                 * }
     87                                                                 */
     88                                                                $attachment_size = apply_filters( 'twentytwelve_attachment_size', $size );
    7889                                                                echo wp_get_attachment_image( $post->ID, $attachment_size );
    7990                                                                ?></a>
    8091
  • src/wp-content/themes/twentytwelve/inc/custom-header.php

     
    11<?php
    22/**
    3  * Implements an optional custom header for Twenty Twelve.
     3 * Implement an optional custom header for Twenty Twelve
     4 *
    45 * See http://codex.wordpress.org/Custom_Headers
    56 *
    67 * @package WordPress
     
    910 */
    1011
    1112/**
    12  * Sets up the WordPress core custom header arguments and settings.
     13 * Set up the WordPress core custom header arguments and settings.
    1314 *
    1415 * @uses add_theme_support() to register support for 3.4 and up.
    1516 * @uses twentytwelve_header_style() to style front-end.
     
    4748add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' );
    4849
    4950/**
    50  * Loads our special font CSS file.
     51 * Load our special font CSS file.
    5152 *
    5253 * @since Twenty Twelve 1.2
    5354 *
     
    6162add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' );
    6263
    6364/**
    64  * Styles the header text displayed on the blog.
     65 * Style the header text displayed on the blog.
    6566 *
    6667 * get_header_textcolor() options: 515151 is default, hide text (returns 'blank'), or any hex value.
    6768 *
     
    101102}
    102103
    103104/**
    104  * Styles the header image displayed on the Appearance > Header admin panel.
     105 * Style the header image displayed on the Appearance > Header admin panel.
    105106 *
    106107 * @since Twenty Twelve 1.0
    107108 */
     
    141142}
    142143
    143144/**
    144  * Outputs markup to be displayed on the Appearance > Header admin panel.
     145 * Output markup to be displayed on the Appearance > Header admin panel.
     146 *
    145147 * This callback overrides the default markup displayed there.
    146148 *
    147149 * @since Twenty Twelve 1.0
  • src/wp-content/themes/twentytwelve/index.php

     
    11<?php
    22/**
    3  * The main template file.
     3 * The 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).
    77 * It is used to display a page when nothing more specific matches a query.
    88 * For example, it puts together the home page when no home.php file exists.
    99 *
    10  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     10 * @link http://codex.wordpress.org/Template_Hierarchy
    1111 *
    1212 * @package WordPress
    1313 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/page.php

     
    11<?php
    22/**
    3  * The template for displaying all pages.
     3 * The 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/twentytwelve/search.php

     
    11<?php
    22/**
    3  * The template for displaying Search Results pages.
     3 * The template for displaying Search Results pages
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/sidebar-front.php

     
    11<?php
    22/**
    3  * The sidebar containing the front page widget areas.
     3 * The sidebar containing the front page widget areas
    44 *
    5  * If no active widgets in either sidebar, they will be hidden completely.
     5 * If no active widgets are in either sidebar, hide them completely.
    66 *
    77 * @package WordPress
    88 * @subpackage Twenty_Twelve
    99 * @since Twenty Twelve 1.0
    1010 */
    1111
    12 /*
     12/**
    1313 * The front page widget area is triggered if any of the areas
    1414 * have widgets. So let's check that first.
    1515 *
  • src/wp-content/themes/twentytwelve/sidebar.php

     
    11<?php
    22/**
    3  * The sidebar containing the main widget area.
     3 * The sidebar containing the main widget area
    44 *
    5  * If no active widgets in sidebar, let's hide it completely.
     5 * If no active widgets are in the sidebar, hide it completely.
    66 *
    77 * @package WordPress
    88 * @subpackage Twenty_Twelve
  • src/wp-content/themes/twentytwelve/single.php

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

     
    11<?php
    22/**
    3  * The template for displaying Tag pages.
     3 * The template for displaying Tag pages
    44 *
    55 * Used to display archive-type pages for posts in a tag.
    66 *
    7  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     7 * @link http://codex.wordpress.org/Template_Hierarchy
    88 *
    99 * @package WordPress
    1010 * @subpackage Twenty_Twelve
     
    2929                        /* Start the Loop */
    3030                        while ( have_posts() ) : the_post();
    3131
    32                                 /* Include the post format-specific template for the content. If you want to
     32                                /**
     33                                 * Include the post format-specific template for the content. If you want to
    3334                                 * this in a child theme then include a file called called content-___.php
    3435                                 * (where ___ is the post format) and that will be used instead.
    3536                                 */