Make WordPress Core

Changeset 26556


Ignore:
Timestamp:
12/03/2013 05:05:53 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: update comment blocks to match inline docs standards. Props DrewAPicture, see #25837.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/archive.php

    r26217 r26556  
    4646
    4747            <?php
    48                     while ( have_posts() ) :
    49                         the_post();
     48                    // Start the Loop.
     49                    while ( have_posts() ) : the_post();
    5050
     51                        /*
     52                         * Include the post format-specific template for the content. If you want to
     53                         * use this in a child theme, then include a file called called content-___.php
     54                         * (where ___ is the post format) and that will be used instead.
     55                         */
    5156                        get_template_part( 'content', get_post_format() );
     57
    5258                    endwhile;
     59                    // Previous/next page navigation.
    5360                    twentyfourteen_paging_nav();
    5461
    5562                else :
     63                    // If no content, include the "No posts found" template.
    5664                    get_template_part( 'content', 'none' );
    5765
  • trunk/src/wp-content/themes/twentyfourteen/author.php

    r25769 r26556  
    4646                    rewind_posts();
    4747
    48                     while ( have_posts() ) :
    49                         the_post();
     48                    // Start the Loop.
     49                    while ( have_posts() ) : the_post();
    5050
     51                        /*
     52                         * Include the post format-specific template for the content. If you want to
     53                         * use this in a child theme, then include a file called called content-___.php
     54                         * (where ___ is the post format) and that will be used instead.
     55                         */
    5156                        get_template_part( 'content', get_post_format() );
     57
    5258                    endwhile;
     59                    // Previous/next page navigation.
    5360                    twentyfourteen_paging_nav();
    5461
    5562                else :
     63                    // If no content, include the "No posts found" template.
    5664                    get_template_part( 'content', 'none' );
    5765
  • trunk/src/wp-content/themes/twentyfourteen/category.php

    r26217 r26556  
    3030
    3131            <?php
    32                     while ( have_posts() ) :
    33                         the_post();
     32                    // Start the Loop.
     33                    while ( have_posts() ) : the_post();
    3434
    35                         get_template_part( 'content', get_post_format() );
     35                    /*
     36                     * Include the post format-specific template for the content. If you want to
     37                     * use this in a child theme, then include a file called called content-___.php
     38                     * (where ___ is the post format) and that will be used instead.
     39                     */
     40                    get_template_part( 'content', get_post_format() );
     41
    3642                    endwhile;
     43                    // Previous/next page navigation.
    3744                    twentyfourteen_paging_nav();
    3845
    3946                else :
     47                    // If no content, include the "No posts found" template.
    4048                    get_template_part( 'content', 'none' );
    4149
  • trunk/src/wp-content/themes/twentyfourteen/content-featured-post.php

    r26260 r26556  
    1212    <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
    1313    <?php
     14        // Output the featured image.
    1415        if ( has_post_thumbnail() ) :
    1516            if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) {
  • trunk/src/wp-content/themes/twentyfourteen/content-page.php

    r25802 r26556  
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1212    <?php
     13        // Page thumbnail and title.
    1314        twentyfourteen_post_thumbnail();
    1415        the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
  • trunk/src/wp-content/themes/twentyfourteen/featured-content.php

    r26019 r26556  
    1212    <div class="featured-content-inner">
    1313    <?php
     14        /**
     15         * Fires before the Twenty Fourteen featured content.
     16         *
     17         * @since Twenty Fourteen 1.0
     18         */
    1419        do_action( 'twentyfourteen_featured_posts_before' );
    1520
     
    1823            setup_postdata( $post );
    1924
     25             // Include the featured content template.
    2026            get_template_part( 'content', 'featured-post' );
    2127        endforeach;
    2228
     29        /**
     30         * Fires after the Twenty Fourteen featured content.
     31         *
     32         * @since Twenty Fourteen 1.0
     33         */
    2334        do_action( 'twentyfourteen_featured_posts_after' );
    2435
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r26325 r26556  
    77 * hooks in WordPress to change core functionality.
    88 *
    9  * When using a child theme (see http://codex.wordpress.org/Theme_Development
    10  * and http://codex.wordpress.org/Child_Themes), you can override certain
    11  * functions (those wrapped in a function_exists() call) by defining them first
    12  * in your child theme's functions.php file. The child theme's functions.php
    13  * file is included before the parent theme's file, so the child theme
    14  * functions would be used.
     9 * When using a child theme you can override certain functions (those wrapped
     10 * in a function_exists() call) by defining them first in your child theme's
     11 * functions.php file. The child theme's functions.php file is included before
     12 * the parent theme's file, so the child theme functions would be used.
     13 *
     14 * @link http://codex.wordpress.org/Theme_Development
     15 * @link http://codex.wordpress.org/Child_Themes
    1516 *
    1617 * Functions that are not pluggable (not wrapped in function_exists()) are
     
    2829 * Set up the content width value based on the theme's design.
    2930 *
    30  * @link twentyfourteen_content_width()
     31 * @see twentyfourteen_content_width()
    3132 *
    3233 * @since Twenty Fourteen 1.0
     
    139140 */
    140141function twentyfourteen_get_featured_posts() {
     142    /**
     143     * Filter the featured posts to return in Twenty Fourteen.
     144     *
     145     * @since Twenty Fourteen 1.0
     146     *
     147     * @param array|bool $posts Array of featured posts, otherwise false.
     148     */
    141149    return apply_filters( 'twentyfourteen_get_featured_posts', array() );
    142150}
     
    150158 */
    151159function twentyfourteen_has_featured_posts() {
     160    /** This filter is documented in functions.php */
    152161    return ! is_paged() && (bool) apply_filters( 'twentyfourteen_get_featured_posts', false );
    153162}
    154163
    155164/**
    156  * Register two widget areas.
     165 * Register three Twenty Fourteen widget areas.
    157166 *
    158167 * @since Twenty Fourteen 1.0
     
    215224
    216225/**
    217  * Enqueue scripts and styles for front end.
     226 * Enqueue scripts and styles for the front end.
    218227 *
    219228 * @since Twenty Fourteen 1.0
     
    281290function twentyfourteen_the_attached_image() {
    282291    $post                = get_post();
     292    /**
     293     * Filter the default Twenty Fourteen attachment size.
     294     *
     295     * @since Twenty Fourteen 1.0
     296     *
     297     * @param array $dimensions {
     298     *     An array of height and width dimensions.
     299     *
     300     *     @type int $height Height of the image in pixels. Default 1200.
     301     *     @type int $width  Width of the image in pixels. Default 1200.
     302     * }
     303     */
    283304    $attachment_size     = apply_filters( 'twentyfourteen_attachment_size', array( 1200, 1200 ) );
    284305    $next_attachment_url = wp_get_attachment_url();
  • trunk/src/wp-content/themes/twentyfourteen/image.php

    r26227 r26556  
    88 */
    99
     10// Retrieve attachment metadata.
    1011$metadata = wp_get_attachment_metadata();
    1112
     
    1617        <div id="content" class="site-content" role="main">
    1718
    18         <?php while ( have_posts() ) : the_post(); ?>
    19 
     19    <?php
     20        // Start the Loop.
     21        while ( have_posts() ) : the_post();
     22    ?>
    2023            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2124                <header class="entry-header">
  • trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php

    r25769 r26556  
    1818 */
    1919function twentyfourteen_custom_header_setup() {
     20    /**
     21     * Filter Twenty Fourteen custom-header support arguments.
     22     *
     23     * @since Twenty Fourteen 1.0
     24     *
     25     * @param array $args {
     26     *     An array of custom-header support arguments.
     27     *
     28     *     @type bool   $header_text            Whether to display custom header text. Default false.
     29     *     @type int    $width                  Width in pixels of the custom header image. Default 1260.
     30     *     @type int    $height                 Height in pixels of the custom header image. Default 240.
     31     *     @type bool   $flex_height            Whether to allow flexible-height header images. Default true.
     32     *     @type string $admin_head_callback    Callback function used to style the image displayed in
     33     *                                          the Appearance > Header screen.
     34     *     @type string $admin_preview_callback Callback function used to create the custom header markup in
     35     *                                          the Appearance > Header screen.
     36     * }
     37     */
    2038    add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array(
    2139        'header-text'            => false,
     
    3149if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) :
    3250/**
    33  * Style the header image displayed on the Appearance > Header admin panel.
     51 * Style the header image displayed on the Appearance > Header screen.
    3452 *
    35  * @link twentyfourteen_custom_header_setup().
     53 * @see twentyfourteen_custom_header_setup()
    3654 *
    3755 * @since Twenty Fourteen 1.0
     
    6684if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) :
    6785/**
    68  * Create the custom header image markup displayed on the Appearance > Header admin panel.
     86 * Create the custom header image markup displayed on the Appearance > Header screen.
    6987 *
    70  * @link twentyfourteen_custom_header_setup().
     88 * @see twentyfourteen_custom_header_setup()
    7189 *
    7290 * @since Twenty Fourteen 1.0
  • trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php

    r26555 r26556  
    7373
    7474/**
    75  * Tweak the brightness of a color by adjusting the RGB values by the given interval.
    76  *
    77  * Use positive values of $steps to brighten the color and negative values to darken the color.
    78  * All three RGB values are modified by the specified steps, within the range of 0-255. The hue
    79  * is generally maintained unless the number of steps causes one value to be capped at 0 or 255.
     75 * Tweak the brightness of a color by adjusting the RGB
     76 * values by the given interval.
     77 *
     78 * Use positive values of $steps to brighten the color and negative
     79 * values to darken the color. All three RGB values are modified by
     80 * the specified steps, within the range of 0-255. The hue is generally
     81 * maintained unless the number of steps causes one value to be capped
     82 * at 0 or 255.
    8083 *
    8184 * @since Twenty Fourteen 1.0
    8285 *
    8386 * @param string $color The original color, in 3- or 6-digit hexadecimal form.
    84  * @param int $steps The number of steps to adjust the color by, in RGB units.
     87 * @param int    $steps The number of steps to adjust the color by, in RGB units.
    8588 * @return string $color The new color, in 6-digit hexadecimal form.
    8689 */
     
    110113
    111114 /**
    112  * Returns a slightly lighter color than what is set as the theme's
     115 * Return a slightly lighter color than what is set as the theme's
    113116 * accent color.
    114117 *
    115118 * @since Twenty Fourteen 1.0
    116119 *
    117  * @return string
     120 * @return string Hex color.
    118121 */
    119122function twentyfourteen_accent_mid() {
     
    122125
    123126/**
    124  * Returns a lighter color than what is set as the theme's accent color.
    125  *
    126  * @since Twenty Fourteen 1.0
    127  *
    128  * @return string
     127 * Return a lighter color than what is set as the theme's accent color.
     128 *
     129 * @since Twenty Fourteen 1.0
     130 *
     131 * @return string Hex color.
    129132 */
    130133function twentyfourteen_accent_light() {
     
    133136
    134137/**
    135  * Caches the generated variants of the theme's accent color.
     138 * Cache the generated variants of the theme's accent color.
    136139 *
    137140 * @since Twenty Fourteen 1.0
     
    325328
    326329/**
    327  * Adds contextual help to the Themes and Post edit screens.
     330 * Add contextual help to the Themes and Post edit screens.
    328331 *
    329332 * @since Twenty Fourteen 1.0
  • trunk/src/wp-content/themes/twentyfourteen/inc/featured-content.php

    r26361 r26556  
    33 * Twenty Fourteen Featured Content
    44 *
    5  * This module allows you to define a subset of posts to be displayed in the
    6  * theme's Featured Content area.
     5 * This module allows you to define a subset of posts to be displayed
     6 * in the theme's Featured Content area.
    77 *
    8  * For maximum compatibility with different methods of posting users will
    9  * designate a featured post tag to associate posts with. Since this tag now
    10  * has special meaning beyond that of a normal tags, users will have the
    11  * ability to hide it from the front-end of their site.
     8 * For maximum compatibility with different methods of posting users
     9 * will designate a featured post tag to associate posts with. Since
     10 * this tag now has special meaning beyond that of a normal tags, users
     11 * will have the ability to hide it from the front-end of their site.
    1212 */
    1313class Featured_Content {
    1414
    1515    /**
    16      * The maximum number of posts that a Featured Content area can contain. We
    17      * define a default value here but themes can override this by defining a
    18      * "max_posts" entry in the second parameter passed in the call to
    19      * add_theme_support( 'featured-content' ).
     16     * The maximum number of posts a Featured Content area can contain.
     17     *
     18     * We define a default value here but themes can override
     19     * this by defining a "max_posts" entry in the second parameter
     20     * passed in the call to add_theme_support( 'featured-content' ).
    2021     *
    2122     * @see Featured_Content::init()
     23     *
     24     * @since Twenty Fourteen 1.0
     25     *
     26     * @static
     27     * @access public
     28     * @var int
    2229     */
    2330    public static $max_posts = 15;
    2431
    2532    /**
    26      * Instantiate
     33     * Instantiate.
    2734     *
    2835     * All custom functionality will be hooked into the "init" action.
     36     *
     37     * @static
     38     * @access public
     39     * @since Twenty Fourteen 1.0
    2940     */
    3041    public static function setup() {
     
    3344
    3445    /**
    35      * Conditionally hook into WordPress
     46     * Conditionally hook into WordPress.
    3647     *
    3748     * Theme must declare that they support this module by adding
     
    4152     * We'll just return early instead.
    4253     *
    43      * @uses Featured_Content::$max_posts
     54     * @static
     55     * @access public
     56     * @since Twenty Fourteen 1.0
    4457     */
    4558    public static function init() {
     
    8699     * Has to run on wp_loaded so that the preview filters of the customizer
    87100     * have a chance to alter the value.
     101     *
     102     * @static
     103     * @access public
     104     * @since Twenty Fourteen 1.0
    88105     */
    89106    public static function wp_loaded() {
     
    95112
    96113    /**
    97      * Get featured posts
    98      *
    99      * @uses Featured_Content::get_featured_post_ids()
    100      *
    101      * @return array
     114     * Get featured posts.
     115     *
     116     * @static
     117     * @access public
     118     * @since Twenty Fourteen 1.0
     119     *
     120     * @return array Array of featured posts.
    102121     */
    103122    public static function get_featured_posts() {
     
    125144     * Sets the "featured_content_ids" transient.
    126145     *
    127      * @return array Array of post IDs
     146     * @static
     147     * @access public
     148     * @since Twenty Fourteen 1.0
     149     *
     150     * @return array Array of post IDs.
    128151     */
    129152    public static function get_featured_post_ids() {
     
    171194
    172195    /**
    173      * Returns an array with IDs of posts maked as sticky.
    174      *
    175      * @return array
     196     * Return an array with IDs of posts maked as sticky.
     197     *
     198     * @static
     199     * @access public
     200     * @since Twenty Fourteen 1.0
     201     *
     202     * @return array Array of sticky posts.
    176203     */
    177204    public static function get_sticky_posts() {
     
    181208
    182209    /**
    183      * Delete transient
     210     * Delete featured content ids transient.
    184211     *
    185212     * Hooks in the "save_post" action.
     213     *
    186214     * @see Featured_Content::validate_settings().
     215     *
     216     * @static
     217     * @access public
     218     * @since Twenty Fourteen 1.0
    187219     */
    188220    public static function delete_transient() {
     
    191223
    192224    /**
    193      * Exclude featured posts from the home page blog query
    194      *
    195      * Filter the home page posts, and remove any featured post ID's from it. Hooked
    196      * onto the 'pre_get_posts' action, this changes the parameters of the query
    197      * before it gets any posts.
    198      *
    199      * @uses Featured_Content::get_featured_post_ids();
    200      * @param WP_Query $query
    201      * @return WP_Query Possibly modified WP_Query
     225     * Exclude featured posts from the home page blog query.
     226     *
     227     * Filter the home page posts, and remove any featured post ID's from it.
     228     * Hooked onto the 'pre_get_posts' action, this changes the parameters of
     229     * the query before it gets any posts.
     230     *
     231     * @static
     232     * @access public
     233     * @since Twenty Fourteen 1.0
     234     *
     235     * @param WP_Query $query WP_Query object.
     236     * @return WP_Query Possibly-modified WP_Query.
    202237     */
    203238    public static function pre_get_posts( $query ) {
     
    234269
    235270    /**
    236      * Reset tag option when the saved tag is deleted
    237      *
    238      * It's important to mention that the transient needs to be deleted, too.
    239      * While it may not be obvious by looking at the function alone, the transient
    240      * is deleted by Featured_Content::validate_settings().
     271     * Reset tag option when the saved tag is deleted.
     272     *
     273     * It's important to mention that the transient needs to be deleted,
     274     * too. While it may not be obvious by looking at the function alone,
     275     * the transient is deleted by Featured_Content::validate_settings().
    241276     *
    242277     * Hooks in the "delete_post_tag" action.
     278     *
    243279     * @see Featured_Content::validate_settings().
     280     *
     281     * @static
     282     * @access public
     283     * @since Twenty Fourteen 1.0
    244284     *
    245285     * @param int $tag_id The term_id of the tag that has been deleted.
     
    259299
    260300    /**
    261      * Hide featured tag from displaying when global terms are queried from the front-end
     301     * Hide featured tag from displaying when global terms are queried from the front-end.
    262302     *
    263303     * Hooks into the "get_terms" filter.
    264304     *
    265      * @param array $terms A list of term objects. This is the return value of get_terms().
     305     * @static
     306     * @access public
     307     * @since Twenty Fourteen 1.0
     308     *
     309     * @param array $terms      List of term objects. This is the return value of get_terms().
    266310     * @param array $taxonomies An array of taxonomy slugs.
    267      * @return array $terms
     311     * @return array A filtered array of terms.
    268312     *
    269313     * @uses Featured_Content::get_setting()
     
    296340
    297341    /**
    298      * Hide featured tag from display when terms associated with a post object are queried from the front-end
     342     * Hide featured tag from display when terms associated with a post object
     343     * are queried from the front-end.
    299344     *
    300345     * Hooks into the "get_the_terms" filter.
    301346     *
    302      * @param array $terms A list of term objects. This is the return value of get_the_terms().
    303      * @param int $id The ID field for the post object that terms are associated with.
     347     * @static
     348     * @access public
     349     * @since Twenty Fourteen 1.0
     350     *
     351     * @param array $terms    A list of term objects. This is the return value of get_the_terms().
     352     * @param int   $id       The ID field for the post object that terms are associated with.
    304353     * @param array $taxonomy An array of taxonomy slugs.
    305      * @return array $terms
     354     * @return array Filtered array of terms.
    306355     *
    307356     * @uses Featured_Content::get_setting()
     
    334383
    335384    /**
    336      * Register custom setting on the Settings -> Reading screen
    337      *
    338      * @uses Featured_Content::render_form()
    339      * @uses Featured_Content::validate_settings()
     385     * Register custom setting on the Settings -> Reading screen.
     386     *
     387     * @static
     388     * @access public
     389     * @since Twenty Fourteen 1.0
    340390     *
    341391     * @return void
     
    347397    /**
    348398     * Add settings to the Customizer.
     399     *
     400     * @static
     401     * @access public
     402     * @since Twenty Fourteen 1.0
    349403     *
    350404     * @param WP_Customize_Manager $wp_customize Theme Customizer object.
     
    387441     * Enqueue the tag suggestion script.
    388442     *
     443     * @static
     444     * @access public
    389445     * @since Twenty Fourteen 1.0
    390446     */
     
    394450
    395451    /**
    396      * Get settings
    397      *
    398      * Get all settings recognized by this module. This function will return
    399      * all settings whether or not they have been stored in the database yet.
    400      * This ensures that all keys are available at all times.
    401      *
    402      * In the event that you only require one setting, you may pass its name
    403      * as the first parameter to the function and only that value will be returned.
    404      *
    405      * @uses Featured_Content::sanitize_quantity()
     452     * Get featured content settings.
     453     *
     454     * Get all settings recognized by this module. This function
     455     * will return all settings whether or not they have been stored
     456     * in the database yet. This ensures that all keys are available
     457     * at all times.
     458     *
     459     * In the event that you only require one setting, you may pass
     460     * its name as the first parameter to the function and only that
     461     * value will be returned.
     462     *
     463     * @static
     464     * @access public
     465     * @since Twenty Fourteen 1.0
    406466     *
    407467     * @param string $key The key of a recognized setting.
     
    430490
    431491    /**
    432      * Validate settings
    433      *
    434      * Make sure that all user supplied content is in an
    435      * expected format before saving to the database. This
    436      * function will also delete the transient set in
    437      * Featured_Content::get_featured_content().
    438      *
    439      * @uses Featured_Content::self::sanitize_quantity()
    440      * @uses Featured_Content::self::delete_transient()
    441      *
    442      * @param array $input
    443      * @return array $output
     492     * Validate featured content settings.
     493     *
     494     * Make sure that all user supplied content is in an expected
     495     * format before saving to the database. This function will also
     496     * delete the transient set in Featured_Content::get_featured_content().
     497     *
     498     * @static
     499     * @access public
     500     * @since Twenty Fourteen 1.0
     501     *
     502     * @param array $input Array of settings input.
     503     * @return array Validated settings output.
    444504     */
    445505    public static function validate_settings( $input ) {
     
    470530        $output['hide-tag'] = isset( $input['hide-tag'] ) && $input['hide-tag'] ? 1 : 0;
    471531
     532        // Delete the featured post ids transient.
    472533        self::delete_transient();
    473534
     
    476537
    477538    /**
    478      * Sanitize quantity
     539     * Sanitize quantity of featured posts.
     540     *
     541     * @static
     542     * @access public
     543     * @since Twenty Fourteen 1.0
    479544     *
    480545     * @param int $input The value to sanitize.
    481546     * @return int A number between 1 and FeaturedContent::$max_posts.
    482      *
    483      * @uses Featured_Content::$max_posts
    484547     */
    485548    public static function sanitize_quantity( $input ) {
     
    494557        return $quantity;
    495558    }
    496 }
     559
     560} // Featured_Content
    497561
    498562Featured_Content::setup();
  • trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php

    r26260 r26556  
    3737    $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';
    3838
    39     $links   = paginate_links( array(
     39    // Set up paginated links.
     40    $links = paginate_links( array(
    4041        'base'     => $pagenum_link,
    4142        'format'   => $format,
     
    110111    }
    111112
     113    // Set up and print post meta information.
    112114    printf( __( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', 'twentyfourteen' ),
    113115        esc_url( get_permalink() ),
     
    150152
    151153/**
    152  * Flush out the transients used in twentyfourteen_categorized_blog
     154 * Flush out the transients used in twentyfourteen_categorized_blog.
    153155 *
    154156 * @since Twenty Fourteen 1.0
     
    164166
    165167/**
    166  * Displays an optional post thumbnail, with an anchor element
    167  * when on index views, and a div element when on a single view.
     168 * Display an optional post thumbnail on a single view.
     169 *
     170 * Adds an anchor element to the post thumbnail, when on
     171 * index views, and a div element when on a single view.
    168172 *
    169173 * @since Twenty Fourteen 1.0
  • trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php

    r26355 r26556  
    1717     * The supported post formats.
    1818     *
     19     * @access private
    1920     * @since Twenty Fourteen 1.0
    2021     *
     
    2627     * Pluralized post format strings.
    2728     *
     29     * @access private
    2830     * @since Twenty Fourteen 1.0
    2931     *
     
    6668     * Output the HTML for this widget.
    6769     *
    68      * @since Twenty Fourteen 1.0
    69      *
    70      * @param array $args An array of standard parameters for widgets in this theme.
     70     * @access public
     71     * @since Twenty Fourteen 1.0
     72     *
     73     * @param array $args     An array of standard parameters for widgets in this theme.
    7174     * @param array $instance An array of settings for this widget instance.
    7275     * @return void Echoes its output.
     
    220223
    221224    /**
    222      * Deal with the settings when they are saved by the admin. Here is where
    223      * any validation should happen.
    224      *
    225      * @since Twenty Fourteen 1.0
    226      *
    227      * @param array $new_instance
    228      * @param array $instance
    229      * @return array
     225     * Deal with the settings when they are saved by the admin.
     226     *
     227     * Here is where any validation should happen.
     228     *
     229     * @since Twenty Fourteen 1.0
     230     *
     231     * @param array $new_instance New widget instance.
     232     * @param array $instance     Original widget instance.
     233     * @return array Updated widget instance.
    230234     */
    231235    function update( $new_instance, $instance ) {
  • trunk/src/wp-content/themes/twentyfourteen/index.php

    r26260 r26556  
    33 * The main template file
    44 *
    5  * This is the most generic template file in a WordPress theme
    6  * and one of the two required files for a theme (the other being style.css).
    7  * It is used to display a page when nothing more specific matches a query.
    8  * E.g., it puts together the home page when no home.php file exists.
     5 * This is the most generic template file in a WordPress theme and one
     6 * of the two required files for a theme (the other being style.css).
     7 * It is used to display a page when nothing more specific matches a query,
     8 * e.g., it puts together the home page when no home.php file exists.
     9 *
    910 * @link http://codex.wordpress.org/Template_Hierarchy
    1011 *
     
    1920
    2021<?php
    21     if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     22    if ( is_front_page() && twentyfourteen_has_featured_posts() ) :
     23        // Include the featured content template.
    2224        get_template_part( 'featured-content' );
    23     }
     25    endif;
    2426?>
    2527
     
    2931        <?php
    3032            if ( have_posts() ) :
    31                 while ( have_posts() ) :
    32                     the_post();
     33                // Start the Loop.
     34                while ( have_posts() ) : the_post();
    3335
     36                    /*
     37                     * Include the post format-specific template for the content. If you want to
     38                     * use this in a child theme, then include a file called called content-___.php
     39                     * (where ___ is the post format) and that will be used instead.
     40                     */
    3441                    get_template_part( 'content', get_post_format() );
     42
    3543                endwhile;
     44                // Previous/next post navigation.
    3645                twentyfourteen_paging_nav();
    3746
    3847            else :
     48                // If no content, include the "No posts found" template.
    3949                get_template_part( 'content', 'none' );
    4050
  • trunk/src/wp-content/themes/twentyfourteen/page-templates/contributors.php

    r26260 r26556  
    1414<?php
    1515    if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     16        // Include the featured content template.
    1617        get_template_part( 'featured-content' );
    1718    }
     
    2122        <div id="content" class="site-content" role="main">
    2223            <?php
    23                 while ( have_posts() ) :
    24                     the_post();
     24                // Start the Loop.
     25                while ( have_posts() ) : the_post();
    2526            ?>
    2627
     
    2930                    the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
    3031
     32                    // Output the authors list.
    3133                    twentyfourteen_list_authors();
    3234
  • trunk/src/wp-content/themes/twentyfourteen/page-templates/full-width.php

    r26260 r26556  
    1414<?php
    1515    if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     16        // Include the featured content template.
    1617        get_template_part( 'featured-content' );
    1718    }
     
    2122        <div id="content" class="site-content" role="main">
    2223            <?php
    23                 while ( have_posts() ) :
    24                     the_post();
     24                // Start the Loop.
     25                while ( have_posts() ) : the_post();
    2526
     27                    // Include the page content template.
    2628                    get_template_part( 'content', 'page' );
    2729
  • trunk/src/wp-content/themes/twentyfourteen/page.php

    r26260 r26556  
    44 *
    55 * This is the template that displays all pages by default.
    6  * Please note that this is the WordPress construct of pages and that other 'pages'
    7  * on your WordPress site will use a different template.
     6 * Please note that this is the WordPress construct of pages and that
     7 * other 'pages' on your WordPress site will use a different template.
    88 *
    99 * @package WordPress
     
    1717
    1818<?php
    19     if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     19    if ( is_front_page() && twentyfourteen_has_featured_posts() ) :\
     20        // Include the featured content template.
    2021        get_template_part( 'featured-content' );
    21     }
     22    endif;
    2223?>
    2324    <div id="primary" class="content-area">
     
    2526
    2627            <?php
    27                 while ( have_posts() ) :
    28                     the_post();
     28                // Start the Loop.
     29                while ( have_posts() ) : the_post();
    2930
     31                    // Include the page content template.
    3032                    get_template_part( 'content', 'page' );
    3133
    3234                    // If comments are open or we have at least one comment, load up the comment template.
    33                     if ( comments_open() || get_comments_number() ) {
     35                    if ( comments_open() || get_comments_number() ) :
    3436                        comments_template();
    35                     }
     37                    endif;
    3638                endwhile;
    3739            ?>
  • trunk/src/wp-content/themes/twentyfourteen/search.php

    r26227 r26556  
    1919            </header><!-- .page-header -->
    2020
    21             <?php
    22                     while ( have_posts() ) :
    23                         the_post();
     21                <?php
     22                    // Start the Loop.
     23                    while ( have_posts() ) : the_post();
    2424
     25                        /*
     26                         * Include the post format-specific template for the content. If you want to
     27                         * use this in a child theme, then include a file called called content-___.php
     28                         * (where ___ is the post format) and that will be used instead.
     29                         */
    2530                        get_template_part( 'content', get_post_format() );
     31
    2632                    endwhile;
     33                    // Previous/next post navigation.
    2734                    twentyfourteen_paging_nav();
    2835
    2936                else :
     37                    // If no content, include the "No posts found" template.
    3038                    get_template_part( 'content', 'none' );
    3139
  • trunk/src/wp-content/themes/twentyfourteen/single.php

    r26260 r26556  
    1313        <div id="content" class="site-content" role="main">
    1414            <?php
    15                 while ( have_posts() ) :
    16                     the_post();
     15                // Start the Loop.
     16                while ( have_posts() ) : the_post();
    1717
     18                    /*
     19                     * Include the post format-specific template for the content. If you want to
     20                     * use this in a child theme, then include a file called called content-___.php
     21                     * (where ___ is the post format) and that will be used instead.
     22                     */
    1823                    get_template_part( 'content', get_post_format() );
    1924
     25                    // Previous/next post navigation.
    2026                    twentyfourteen_post_nav();
    2127
  • trunk/src/wp-content/themes/twentyfourteen/tag.php

    r26217 r26556  
    3232
    3333            <?php
    34                     while ( have_posts() ) :
    35                         the_post();
     34                    // Start the Loop.
     35                    while ( have_posts() ) : the_post();
    3636
     37                        /*
     38                         * Include the post format-specific template for the content. If you want to
     39                         * use this in a child theme, then include a file called called content-___.php
     40                         * (where ___ is the post format) and that will be used instead.
     41                         */
    3742                        get_template_part( 'content', get_post_format() );
     43
    3844                    endwhile;
     45                    // Previous/next page navigation.
    3946                    twentyfourteen_paging_nav();
    4047
    4148                else :
     49                    // If no content, include the "No posts found" template.
    4250                    get_template_part( 'content', 'none' );
    4351
  • trunk/src/wp-content/themes/twentyfourteen/taxonomy-post_format.php

    r26217 r26556  
    5454
    5555            <?php
    56                     while ( have_posts() ) :
    57                         the_post();
     56                    // Start the Loop.
     57                    while ( have_posts() ) : the_post();
    5858
     59                        /*
     60                         * Include the post format-specific template for the content. If you want to
     61                         * use this in a child theme, then include a file called called content-___.php
     62                         * (where ___ is the post format) and that will be used instead.
     63                         */
    5964                        get_template_part( 'content', get_post_format() );
     65
    6066                    endwhile;
     67                    // Previous/next page navigation.
    6168                    twentyfourteen_paging_nav();
    6269
    6370                else :
     71                    // If no content, include the "No posts found" template.
    6472                    get_template_part( 'content', 'none' );
    6573
Note: See TracChangeset for help on using the changeset viewer.