Make WordPress Core

Ticket #25257: 25257.2.diff

File 25257.2.diff, 38.4 KB (added by DrewAPicture, 12 years ago)

Docs only

  • src/wp-content/themes/twentyfourteen/archive.php

     
    4545                        </header><!-- .page-header -->
    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
    5866                                endif;
  • src/wp-content/themes/twentyfourteen/author.php

     
    4545                                         */
    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
    5866                                endif;
  • src/wp-content/themes/twentyfourteen/category.php

     
    2929                        </header><!-- .archive-header -->
    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
    4250                                endif;
  • src/wp-content/themes/twentyfourteen/content-featured-post.php

     
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    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' ) ) {
    1617                                the_post_thumbnail();
  • src/wp-content/themes/twentyfourteen/content-page.php

     
    1010
    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 -->' );
    1516        ?>
  • src/wp-content/themes/twentyfourteen/featured-content.php

     
    1111<div id="featured-content" class="featured-content">
    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
    1621                $featured_posts = twentyfourteen_get_featured_posts();
    1722                foreach ( (array) $featured_posts as $order => $post ) :
    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
    2536                wp_reset_postdata();
  • src/wp-content/themes/twentyfourteen/functions.php

     
    66 * theme as custom template tags. Others are attached to action and filter
    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.
    1513 *
     14 * @link http://codex.wordpress.org/Theme_Development
     15 * @link http://codex.wordpress.org/Child_Themes
     16 *
    1617 * Functions that are not pluggable (not wrapped in function_exists()) are
    1718 * instead attached to a filter or action hook.
    1819 *
     
    2728/**
    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
    3334 */
     
    138139 * @return array An array of WP_Post objects.
    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}
    143151
     
    149157 * @return bool Whether there are featured posts.
    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 two Twenty Fourteen widget areas.
    157166 *
    158167 * @since Twenty Fourteen 1.0
    159168 *
     
    214223}
    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
    220229 *
     
    280289 */
    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();
    285306
  • src/wp-content/themes/twentyfourteen/image.php

     
    77 * @since Twenty Fourteen 1.0
    88 */
    99
     10// Retrieve attachment metadata.
    1011$metadata = wp_get_attachment_metadata();
    1112
    1213get_header();
     
    1516        <section id="primary" class="content-area image-attachment">
    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">
    2225                                        <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  • src/wp-content/themes/twentyfourteen/inc/custom-header.php

     
    1717 * @uses twentyfourteen_admin_header_image()
    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,
    2240                'width'                  => 1260,
     
    3048
    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
    3856 */
     
    6583
    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
    7391 */
  • src/wp-content/themes/twentyfourteen/inc/customizer.php

     
    7272add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' );
    7373
    7474/**
    75  * Tweak the brightness of a color by adjusting the RGB values by the given interval.
     75 * Tweak the brightness of a color by adjusting the RGB
     76 * values by the given interval.
    7677 *
    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.
     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 */
    8790function twentyfourteen_adjust_color( $color, $steps ) {
     
    109112}
    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() {
    120123        return twentyfourteen_adjust_color( get_theme_mod( 'accent_color' ), 29 );
    121124}
    122125
    123126/**
    124  * Returns a lighter color than what is set as the theme's accent color.
     127 * Return a lighter color than what is set as the theme's accent color.
    125128 *
    126129 * @since Twenty Fourteen 1.0
    127130 *
    128  * @return string
     131 * @return string Hex color.
    129132 */
    130133function twentyfourteen_accent_light() {
    131134        return twentyfourteen_adjust_color( get_theme_mod( 'accent_color' ), 49 );
    132135}
    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
    138141 *
     
    324327add_action( 'wp_enqueue_scripts', 'twentyfourteen_customizer_styles' );
    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
    330333 *
  • src/wp-content/themes/twentyfourteen/inc/featured-content.php

     
    22/**
    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.
    2017         *
     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' ).
     21         *
    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() {
    3142                add_action( 'init', array( __CLASS__, 'init' ), 30 );
    3243        }
    3344
    3445        /**
    35          * Conditionally hook into WordPress
     46         * Conditionally hook into WordPress.
    3647         *
    3748         * Theme must declare that they support this module by adding
    3849         * add_theme_support( 'featured-content' ); during after_setup_theme.
     
    4051         * If no theme support is found there is no need to hook into WordPress.
    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() {
    4659                $theme_support = get_theme_support( 'featured-content' );
     
    8598         *
    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() {
    90107                if ( self::get_setting( 'hide-tag' ) ) {
     
    94111        }
    95112
    96113        /**
    97          * Get featured posts
     114         * Get featured posts.
    98115         *
    99          * @uses Featured_Content::get_featured_post_ids()
     116         * @static
     117         * @access public
     118         * @since Twenty Fourteen 1.0
    100119         *
    101          * @return array
     120         * @return array Array of featured posts.
    102121         */
    103122        public static function get_featured_posts() {
    104123                $post_ids = self::get_featured_post_ids();
     
    124143         *
    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() {
    130153                // Return array of cached results if they exist.
     
    170193        }
    171194
    172195        /**
    173          * Returns an array with IDs of posts maked as sticky.
     196         * Return an array with IDs of posts maked as sticky.
    174197         *
    175          * @return array
     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() {
    178205                $settings = self::get_setting();
     
    180207        }
    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() {
    189221                delete_transient( 'featured_content_ids' );
    190222        }
    191223
    192224        /**
    193          * Exclude featured posts from the home page blog query
     225         * Exclude featured posts from the home page blog query.
    194226         *
    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.
     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.
    198230         *
    199          * @uses Featured_Content::get_featured_post_ids();
    200          * @param WP_Query $query
    201          * @return WP_Query Possibly modified WP_Query
     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 ) {
    204239
     
    233268        }
    234269
    235270        /**
    236          * Reset tag option when the saved tag is deleted
     271         * Reset tag option when the saved tag is deleted.
    237272         *
    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().
     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().
    244280         *
     281         * @static
     282         * @access public
     283         * @since Twenty Fourteen 1.0
     284         *
    245285         * @param int $tag_id The term_id of the tag that has been deleted.
    246286         * @return void
    247287         */
     
    258298        }
    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()
    270314         */
     
    295339        }
    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()
    308357         */
     
    333382        }
    334383
    335384        /**
    336          * Register custom setting on the Settings -> Reading screen
     385         * Register custom setting on the Settings -> Reading screen.
    337386         *
    338          * @uses Featured_Content::render_form()
    339          * @uses Featured_Content::validate_settings()
     387         * @static
     388         * @access public
     389         * @since Twenty Fourteen 1.0
    340390         *
    341391         * @return void
    342392         */
     
    347397        /**
    348398         * Add settings to the Customizer.
    349399         *
     400         * @static
     401         * @access public
     402         * @since Twenty Fourteen 1.0
     403         *
    350404         * @param WP_Customize_Manager $wp_customize Theme Customizer object.
    351405         */
    352406        public static function customize_register( $wp_customize ) {
     
    386440        /**
    387441         * Enqueue the tag suggestion script.
    388442         *
     443         * @static
     444         * @access public
    389445         * @since Twenty Fourteen 1.0
    390446         */
    391447        public static function enqueue_scripts() {
     
    393449        }
    394450
    395451        /**
    396          * Get settings
     452         * Get featured content settings.
    397453         *
    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.
     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.
    401458         *
    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.
     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.
    404462         *
    405          * @uses Featured_Content::sanitize_quantity()
     463         * @static
     464         * @access public
     465         * @since Twenty Fourteen 1.0
    406466         *
    407467         * @param string $key The key of a recognized setting.
    408468         * @return mixed Array of all settings by default. A single value if passed as first parameter.
     
    429489        }
    430490
    431491        /**
    432          * Validate settings
     492         * Validate featured content settings.
    433493         *
    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().
     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().
    438497         *
    439          * @uses Featured_Content::self::sanitize_quantity()
    440          * @uses Featured_Content::self::delete_transient()
     498         * @static
     499         * @access public
     500         * @since Twenty Fourteen 1.0
    441501         *
    442          * @param array $input
    443          * @return array $output
     502         * @param array $input Array of settings input.
     503         * @return array Validated settings output.
    444504         */
    445505        public static function validate_settings( $input ) {
    446506                $output = array();
     
    469529
    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
    474535                return $output;
    475536        }
    476537
    477538        /**
    478          * Sanitize quantity
     539         * Sanitize quantity of featured posts.
    479540         *
     541         * @static
     542         * @access public
     543         * @since Twenty Fourteen 1.0
     544         *
    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 ) {
    486549                $quantity = absint( $input );
     
    493556
    494557                return $quantity;
    495558        }
    496 }
    497559
     560} // Featured_Content
     561
    498562Featured_Content::setup();
  • src/wp-content/themes/twentyfourteen/inc/template-tags.php

     
    3636        $format  = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
    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,
    4243                'total'    => $GLOBALS['wp_query']->max_num_pages,
     
    109110                echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>';
    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() ),
    114116                esc_attr( get_the_date( 'c' ) ),
     
    149151}
    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
    155157 *
     
    163165add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );
    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.
    168169 *
     170 * Adds an anchor element to the post thumbnail, when on
     171 * index views, and a div element when on a single view.
     172 *
    169173 * @since Twenty Fourteen 1.0
    170174 *
    171175 * @return void
  • src/wp-content/themes/twentyfourteen/inc/widgets.php

     
    1616        /**
    1717         * The supported post formats.
    1818         *
     19         * @access private
    1920         * @since Twenty Fourteen 1.0
    2021         *
    2122         * @var array
     
    2526        /**
    2627         * Pluralized post format strings.
    2728         *
     29         * @access private
    2830         * @since Twenty Fourteen 1.0
    2931         *
    3032         * @var array
     
    6567        /**
    6668         * Output the HTML for this widget.
    6769         *
     70         * @access public
    6871         * @since Twenty Fourteen 1.0
    6972         *
    70          * @param array $args An array of standard parameters for widgets in this theme.
     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.
    7376         */
     
    219222        }
    220223
    221224        /**
    222          * Deal with the settings when they are saved by the admin. Here is where
    223          * any validation should happen.
     225         * Deal with the settings when they are saved by the admin.
    224226         *
     227         * Here is where any validation should happen.
     228         *
    225229         * @since Twenty Fourteen 1.0
    226230         *
    227          * @param array $new_instance
    228          * @param array $instance
    229          * @return array
     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 ) {
    232236                $instance['title']  = strip_tags( $new_instance['title'] );
  • src/wp-content/themes/twentyfourteen/index.php

     
    22/**
    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 *
    1112 * @package WordPress
     
    1819<div id="main-content" class="main-content">
    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
    2628        <div id="primary" class="content-area">
     
    2830
    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
    4151                        endif;
  • src/wp-content/themes/twentyfourteen/page-templates/contributors.php

     
    1313
    1414<?php
    1515        if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     16                // Include the featured content template.
    1617                get_template_part( 'featured-content' );
    1718        }
    1819?>
     
    2021        <div id="primary" class="content-area">
    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
    2728                        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2829                                <?php
    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
    3335                                        edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' );
  • src/wp-content/themes/twentyfourteen/page-templates/full-width.php

     
    1313
    1414<?php
    1515        if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     16                // Include the featured content template.
    1617                get_template_part( 'featured-content' );
    1718        }
    1819?>
     
    2021        <div id="primary" class="content-area">
    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
    2830                                        // If comments are open or we have at least one comment, load up the comment template.
  • src/wp-content/themes/twentyfourteen/page.php

     
    33 * The template for displaying all pages
    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
    1010 * @subpackage Twenty_Fourteen
     
    1616<div id="main-content" class="main-content">
    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">
    2425                <div id="content" class="site-content" role="main">
    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                        ?>
    3840
  • src/wp-content/themes/twentyfourteen/search.php

     
    1818                                <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), get_search_query() ); ?></h1>
    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
    3240                                endif;
  • src/wp-content/themes/twentyfourteen/single.php

     
    1212        <div id="primary" class="content-area">
    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
    2228                                        // If comments are open or we have at least one comment, load up the comment template.
  • src/wp-content/themes/twentyfourteen/tag.php

     
    3131                        </header><!-- .archive-header -->
    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
    4452                                endif;
  • src/wp-content/themes/twentyfourteen/taxonomy-post_format.php

     
    5353                        </header><!-- .archive-header -->
    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
    6674                                endif;