From eaf78d3f7c219e52f58bf5ae31ca78219a4d5f0b Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 11 Oct 2013 22:02:11 +0000 Subject: [PATCH] Twenty Fourteen: first pass for updating code comments to reflect WP inline docs standards, see #25257. Built from https://develop.svn.wordpress.org/trunk@25769 git-svn-id: http://core.svn.wordpress.org/trunk@25682 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfourteen/404.php | 3 +- wp-content/themes/twentyfourteen/archive.php | 5 +- wp-content/themes/twentyfourteen/author.php | 11 +- wp-content/themes/twentyfourteen/category.php | 5 +- wp-content/themes/twentyfourteen/comments.php | 3 +- .../themes/twentyfourteen/content-aside.php | 3 +- .../twentyfourteen/content-featured-post.php | 3 + .../themes/twentyfourteen/content-gallery.php | 3 +- .../themes/twentyfourteen/content-image.php | 3 +- .../themes/twentyfourteen/content-link.php | 3 +- .../themes/twentyfourteen/content-none.php | 3 +- .../themes/twentyfourteen/content-page.php | 3 +- .../themes/twentyfourteen/content-quote.php | 3 +- .../content-recent-formatted-post.php | 3 + .../themes/twentyfourteen/content-video.php | 3 +- wp-content/themes/twentyfourteen/content.php | 5 + .../twentyfourteen/contributor-page.php | 1 + .../twentyfourteen/featured-content.php | 3 +- wp-content/themes/twentyfourteen/footer.php | 3 +- .../themes/twentyfourteen/front-page.php | 3 +- .../themes/twentyfourteen/full-width-page.php | 1 + .../themes/twentyfourteen/functions.php | 111 ++++++++++++------ wp-content/themes/twentyfourteen/header.php | 3 +- wp-content/themes/twentyfourteen/image.php | 3 +- .../twentyfourteen/inc/custom-header.php | 19 ++- .../themes/twentyfourteen/inc/customizer.php | 28 +++-- .../twentyfourteen/inc/template-tags.php | 34 ++++-- .../themes/twentyfourteen/inc/widgets.php | 34 ++++-- wp-content/themes/twentyfourteen/index.php | 5 +- wp-content/themes/twentyfourteen/page.php | 8 +- wp-content/themes/twentyfourteen/search.php | 3 +- .../themes/twentyfourteen/sidebar-content.php | 3 +- .../themes/twentyfourteen/sidebar-footer.php | 3 +- wp-content/themes/twentyfourteen/sidebar.php | 3 +- wp-content/themes/twentyfourteen/single.php | 3 +- wp-content/themes/twentyfourteen/tag.php | 5 +- .../twentyfourteen/taxonomy-post_format.php | 5 +- 37 files changed, 237 insertions(+), 106 deletions(-) diff --git a/wp-content/themes/twentyfourteen/404.php b/wp-content/themes/twentyfourteen/404.php index df1a51b0ca..2fa6023a61 100644 --- a/wp-content/themes/twentyfourteen/404.php +++ b/wp-content/themes/twentyfourteen/404.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/archive.php b/wp-content/themes/twentyfourteen/archive.php index 3d5a27f70a..158dd3e411 100644 --- a/wp-content/themes/twentyfourteen/archive.php +++ b/wp-content/themes/twentyfourteen/archive.php @@ -1,6 +1,6 @@ diff --git a/wp-content/themes/twentyfourteen/author.php b/wp-content/themes/twentyfourteen/author.php index c5a03d0407..4b4583c0d4 100644 --- a/wp-content/themes/twentyfourteen/author.php +++ b/wp-content/themes/twentyfourteen/author.php @@ -1,11 +1,12 @@ @@ -18,7 +19,8 @@ get_header(); ?>

diff --git a/wp-content/themes/twentyfourteen/comments.php b/wp-content/themes/twentyfourteen/comments.php index 1c7b6771d7..f2036d20a4 100644 --- a/wp-content/themes/twentyfourteen/comments.php +++ b/wp-content/themes/twentyfourteen/comments.php @@ -1,11 +1,12 @@ diff --git a/wp-content/themes/twentyfourteen/content-featured-post.php b/wp-content/themes/twentyfourteen/content-featured-post.php index 10e8f33364..52e5cf6c81 100644 --- a/wp-content/themes/twentyfourteen/content-featured-post.php +++ b/wp-content/themes/twentyfourteen/content-featured-post.php @@ -1,7 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content-gallery.php b/wp-content/themes/twentyfourteen/content-gallery.php index be009dc5e7..6542e73b11 100644 --- a/wp-content/themes/twentyfourteen/content-gallery.php +++ b/wp-content/themes/twentyfourteen/content-gallery.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content-link.php b/wp-content/themes/twentyfourteen/content-link.php index 085499d34f..21c6f1dc78 100644 --- a/wp-content/themes/twentyfourteen/content-link.php +++ b/wp-content/themes/twentyfourteen/content-link.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content-none.php b/wp-content/themes/twentyfourteen/content-none.php index 205f9e98cf..a83e06ee4a 100644 --- a/wp-content/themes/twentyfourteen/content-none.php +++ b/wp-content/themes/twentyfourteen/content-none.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content-page.php b/wp-content/themes/twentyfourteen/content-page.php index 8ffa4c0e49..74175754a5 100644 --- a/wp-content/themes/twentyfourteen/content-page.php +++ b/wp-content/themes/twentyfourteen/content-page.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content-quote.php b/wp-content/themes/twentyfourteen/content-quote.php index cd35719e21..fae0dfeb54 100644 --- a/wp-content/themes/twentyfourteen/content-quote.php +++ b/wp-content/themes/twentyfourteen/content-quote.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content-recent-formatted-post.php b/wp-content/themes/twentyfourteen/content-recent-formatted-post.php index 5a09da081b..9a998a526a 100644 --- a/wp-content/themes/twentyfourteen/content-recent-formatted-post.php +++ b/wp-content/themes/twentyfourteen/content-recent-formatted-post.php @@ -1,7 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/content.php b/wp-content/themes/twentyfourteen/content.php index fdf0ec7ee4..da86e52bda 100644 --- a/wp-content/themes/twentyfourteen/content.php +++ b/wp-content/themes/twentyfourteen/content.php @@ -1,7 +1,12 @@ diff --git a/wp-content/themes/twentyfourteen/contributor-page.php b/wp-content/themes/twentyfourteen/contributor-page.php index 00fbcdcbb3..6775c95b88 100644 --- a/wp-content/themes/twentyfourteen/contributor-page.php +++ b/wp-content/themes/twentyfourteen/contributor-page.php @@ -4,6 +4,7 @@ * * @package WordPress * @subpackage Twenty_Fourteen + * @since Twenty Fourteen 1.0 */ get_header(); ?> diff --git a/wp-content/themes/twentyfourteen/featured-content.php b/wp-content/themes/twentyfourteen/featured-content.php index 7276537913..50b816cf2d 100644 --- a/wp-content/themes/twentyfourteen/featured-content.php +++ b/wp-content/themes/twentyfourteen/featured-content.php @@ -1,11 +1,12 @@ diff --git a/wp-content/themes/twentyfourteen/footer.php b/wp-content/themes/twentyfourteen/footer.php index a668b0c50d..c7956a2d20 100644 --- a/wp-content/themes/twentyfourteen/footer.php +++ b/wp-content/themes/twentyfourteen/footer.php @@ -1,11 +1,12 @@ diff --git a/wp-content/themes/twentyfourteen/front-page.php b/wp-content/themes/twentyfourteen/front-page.php index 55b027e0ca..93b77d2999 100644 --- a/wp-content/themes/twentyfourteen/front-page.php +++ b/wp-content/themes/twentyfourteen/front-page.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/full-width-page.php b/wp-content/themes/twentyfourteen/full-width-page.php index c83382748f..9c391d4719 100644 --- a/wp-content/themes/twentyfourteen/full-width-page.php +++ b/wp-content/themes/twentyfourteen/full-width-page.php @@ -4,6 +4,7 @@ * * @package WordPress * @subpackage Twenty_Fourteen + * @since Twenty Fourteen 1.0 */ get_header(); ?> diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index 0be4546eda..8d75e0d66f 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -1,8 +1,8 @@ for posts and comments. + // Add RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // Enable support for Post Thumbnails. add_theme_support( 'post-thumbnails' ); - // Adding several sizes for Post Thumbnails. + // Add several sizes for Post Thumbnails. add_image_size( 'featured-thumbnail-large', 672, 0 ); add_image_size( 'featured-thumbnail-featured', 672, 336, true ); add_image_size( 'featured-thumbnail-formatted', 306, 0 ); @@ -73,7 +79,7 @@ function twentyfourteen_setup() { ) ); /* - * Switches default core markup for search form, comment form, and comments + * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( @@ -99,7 +105,9 @@ endif; // twentyfourteen_setup add_action( 'after_setup_theme', 'twentyfourteen_setup' ); /** - * Adjusts content_width value for full-width and attachment templates. + * Adjust content_width value for full-width and attachment templates. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -111,6 +119,8 @@ add_action( 'template_redirect', 'twentyfourteen_content_width' ); /** * Getter function for Featured Content Plugin. + * + * @since Twenty Fourteen 1.0 */ function twentyfourteen_get_featured_posts() { return apply_filters( 'twentyfourteen_get_featured_posts', false ); @@ -120,6 +130,8 @@ function twentyfourteen_get_featured_posts() { * A helper conditional function that returns a boolean value * So that we can use a condition like * if ( twentyfourteen_has_featured_posts( 1 ) ) + * + * @since Twenty Fourteen 1.0 */ function twentyfourteen_has_featured_posts( $minimum = 1 ) { if ( is_paged() ) @@ -131,7 +143,9 @@ function twentyfourteen_has_featured_posts( $minimum = 1 ) { } /** - * Registers two widget areas. + * Register two widget areas. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -172,6 +186,8 @@ add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); /** * Register Lato Google font for Twenty Fourteen. * + * @since Twenty Fourteen 1.0 + * * @return void */ function twentyfourteen_font_url() { @@ -187,7 +203,9 @@ function twentyfourteen_font_url() { } /** - * Enqueues scripts and styles for front end. + * Enqueue scripts and styles for front end. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -221,6 +239,8 @@ add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); /** * Enqueue Google fonts style to admin screen for custom header display. * + * @since Twenty Fourteen 1.0 + * * @return void */ function twentyfourteen_admin_fonts() { @@ -229,7 +249,9 @@ function twentyfourteen_admin_fonts() { add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); /** - * Sets the post excerpt length to 20 words. + * Set the post excerpt length to 20 words. + * + * @since Twenty Fourteen 1.0 * * @param int $length * @return int @@ -240,7 +262,9 @@ function twentyfourteen_excerpt_length( $length ) { add_filter( 'excerpt_length', 'twentyfourteen_excerpt_length' ); /** - * Returns a "Continue Reading" link for excerpts + * Return a "Continue Reading" link for excerpts. + * + * @since Twenty Fourteen 1.0 * * @return string */ @@ -249,9 +273,11 @@ function twentyfourteen_continue_reading_link() { } /** - * Replaces "[...]" (appended to automatically generated excerpts) with an + * Replace "[...]" (appended to automatically generated excerpts) with an * ellipsis and twentyeleven_continue_reading_link(). * + * @since Twenty Fourteen 1.0 + * * @param string $more * @return string */ @@ -261,11 +287,13 @@ function twentyfourteen_auto_excerpt_more( $more ) { add_filter( 'excerpt_more', 'twentyfourteen_auto_excerpt_more' ); /** - * Adds a pretty "Continue Reading" link to custom post excerpts. + * Add a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. * + * @since Twenty Fourteen 1.0 + * * @param string $output * @return string */ @@ -279,7 +307,9 @@ add_filter( 'get_the_excerpt', 'twentyfourteen_custom_excerpt_more' ); if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : /** - * Prints the attached image with a link to the next attached image. + * Print the attached image with a link to the next attached image. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -288,7 +318,7 @@ function twentyfourteen_the_attached_image() { $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 1200, 1200 ) ); $next_attachment_url = wp_get_attachment_url(); - /** + /* * Grab the IDs of all the image attachments in a gallery so we can get the URL * of the next adjacent image in a gallery, or the first image (if we're * looking at the last image in a gallery), or, in a gallery of one, just the @@ -332,7 +362,9 @@ endif; if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : /** - * Prints a list of all site contributors who published at least one post. + * Print a list of all site contributors who published at least one post. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -372,8 +404,11 @@ function twentyfourteen_list_authors() { endif; /** - * Gets recent formatted posts that are not featured in FC plugin. + * Get recent formatted posts that are not featured in FC plugin. * + * @since Twenty Fourteen 1.0 + * + * @return object WP_Query */ function twentyfourteen_get_recent( $post_format ) { $args = array( @@ -402,6 +437,9 @@ function twentyfourteen_get_recent( $post_format ) { /** * Filter the home page posts, and remove formatted posts visible in the sidebar from it * + * @since Twenty Fourteen 1.0 + * + * @return void */ function twentyfourteen_pre_get_posts( $query ) { // Bail if not home, not a query, not main query. @@ -443,7 +481,7 @@ function twentyfourteen_pre_get_posts( $query ) { add_action( 'pre_get_posts', 'twentyfourteen_pre_get_posts' ); /** - * Extends the default WordPress body classes. + * Extend the default WordPress body classes. * * Adds body classes to denote: * 1. Single or multiple authors. @@ -451,6 +489,8 @@ add_action( 'pre_get_posts', 'twentyfourteen_pre_get_posts' ); * 3. Full-width content layout. * 4. Presence of footer widgets. * + * @since Twenty Fourteen 1.0 + * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ @@ -475,11 +515,13 @@ function twentyfourteen_body_classes( $classes ) { add_filter( 'body_class', 'twentyfourteen_body_classes' ); /** - * Extends the default WordPress post classes. + * Extend the default WordPress post classes. * * Adds a post class to denote: * Non-password protected page with a featured image. * + * @since Twenty Fourteen 1.0 + * * @param array $classes A list of existing post class values. * @return array The filtered post class list. */ @@ -492,9 +534,11 @@ function twentyfourteen_post_classes( $classes ) { add_filter( 'post_class', 'twentyfourteen_post_classes' ); /** - * Creates a nicely formatted and more specific title element text for output + * Create a nicely formatted and more specific title element text for output * in head of document, based on current view. * + * @since Twenty Fourteen 1.0 + * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string The filtered title. @@ -521,18 +565,11 @@ function twentyfourteen_wp_title( $title, $sep ) { } add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 ); -/** - * Implement the Custom Header feature - * - */ +// Implement Custom Header features. require get_template_directory() . '/inc/custom-header.php'; -/** - * Custom template tags for this theme. - */ +// Custom template tags for this theme. require get_template_directory() . '/inc/template-tags.php'; -/** - * Customizer additions - */ +// Add Theme Customizer functionality. require get_template_directory() . '/inc/customizer.php'; diff --git a/wp-content/themes/twentyfourteen/header.php b/wp-content/themes/twentyfourteen/header.php index abcfb622a0..99801504a6 100644 --- a/wp-content/themes/twentyfourteen/header.php +++ b/wp-content/themes/twentyfourteen/header.php @@ -1,11 +1,12 @@ section and everything up till
* * @package WordPress * @subpackage Twenty_Fourteen + * @since Twenty Fourteen 1.0 */ ?> class="no-js"> diff --git a/wp-content/themes/twentyfourteen/image.php b/wp-content/themes/twentyfourteen/image.php index 8e785ef04f..31b6ac645e 100644 --- a/wp-content/themes/twentyfourteen/image.php +++ b/wp-content/themes/twentyfourteen/image.php @@ -1,9 +1,10 @@ Header admin panel. + * Style the header image displayed on the Appearance > Header admin panel. * - * @see twentyfourteen_custom_header_setup(). + * @link twentyfourteen_custom_header_setup(). + * + * @since Twenty Fourteen 1.0 */ function twentyfourteen_admin_header_style() { ?> @@ -58,9 +65,11 @@ endif; // twentyfourteen_admin_header_style if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : /** - * Custom header image markup displayed on the Appearance > Header admin panel. + * Create the custom header image markup displayed on the Appearance > Header admin panel. * - * @see twentyfourteen_custom_header_setup(). + * @link twentyfourteen_custom_header_setup(). + * + * @since Twenty Fourteen 1.0 */ function twentyfourteen_admin_header_image() { ?> diff --git a/wp-content/themes/twentyfourteen/inc/customizer.php b/wp-content/themes/twentyfourteen/inc/customizer.php index 306e5a4b63..c90b0d2a97 100644 --- a/wp-content/themes/twentyfourteen/inc/customizer.php +++ b/wp-content/themes/twentyfourteen/inc/customizer.php @@ -1,14 +1,17 @@ post_parent ) : get_adjacent_post( false, '', true ); @@ -86,7 +91,9 @@ endif; if ( ! function_exists( 'twentyfourteen_posted_on' ) ) : /** - * Prints HTML with meta information for the current post-date/time and author. + * Print HTML with meta information for the current post-date/time and author. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -105,9 +112,11 @@ function twentyfourteen_posted_on() { endif; /** - * Returns true if a blog has more than 1 category + * Find out if blog has more than one category. * - * @return boolean + * @since Twenty Fourteen 1.0 + * + * @return boolean true if blog has more than 1 category */ function twentyfourteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { @@ -134,6 +143,9 @@ function twentyfourteen_categorized_blog() { /** * Flush out the transients used in twentyfourteen_categorized_blog * + * @since Twenty Fourteen 1.0 + * + * @return void */ function twentyfourteen_category_transient_flusher() { // Like, beat it. Dig? @@ -143,7 +155,9 @@ add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); /** - * Displays featured image with appropriate html tag. + * Display featured image with appropriate HTML tag. + * + * @since Twenty Fourteen 1.0 * * @return void */ diff --git a/wp-content/themes/twentyfourteen/inc/widgets.php b/wp-content/themes/twentyfourteen/inc/widgets.php index ec2d1cdb4f..052692c4bd 100644 --- a/wp-content/themes/twentyfourteen/inc/widgets.php +++ b/wp-content/themes/twentyfourteen/inc/widgets.php @@ -1,12 +1,14 @@ __( 'Use this widget to list your recent Aside, Quote, Video, Image, Gallery, and Link posts', 'twentyfourteen' ), ) ); - /** + /* * @todo http://core.trac.wordpress.org/ticket/23257 */ $this->format_strings = array( @@ -54,7 +62,9 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { } /** - * Outputs the HTML for this widget. + * Output the HTML for this widget. + * + * @since Twenty Fourteen 1.0 * * @param array $args An array of standard parameters for widgets in this theme. * @param array $instance An array of settings for this widget instance. @@ -191,8 +201,10 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { } /** - * Deals with the settings when they are saved by the admin. Here is where - * any validation should be dealt with. + * Deal with the settings when they are saved by the admin. Here is where + * any validation should happen. + * + * @since Twenty Fourteen 1.0 * * @param array $new_instance * @param array $instance @@ -210,7 +222,9 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { } /** - * Deletes the transient. + * Delete the transient. + * + * @since Twenty Fourteen 1.0 * * @return void */ @@ -219,7 +233,9 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { } /** - * Displays the form for this widget on the Widgets page of the Admin area. + * Display the form for this widget on the Widgets page of the Admin area. + * + * @since Twenty Fourteen 1.0 * * @param array $instance * @return void diff --git a/wp-content/themes/twentyfourteen/index.php b/wp-content/themes/twentyfourteen/index.php index 49f0ef91dd..3ea4849c63 100644 --- a/wp-content/themes/twentyfourteen/index.php +++ b/wp-content/themes/twentyfourteen/index.php @@ -1,15 +1,16 @@ diff --git a/wp-content/themes/twentyfourteen/page.php b/wp-content/themes/twentyfourteen/page.php index 0535d4000a..039c7ffaf3 100644 --- a/wp-content/themes/twentyfourteen/page.php +++ b/wp-content/themes/twentyfourteen/page.php @@ -1,14 +1,14 @@ diff --git a/wp-content/themes/twentyfourteen/search.php b/wp-content/themes/twentyfourteen/search.php index 09be4904d7..2ee2bbf06d 100644 --- a/wp-content/themes/twentyfourteen/search.php +++ b/wp-content/themes/twentyfourteen/search.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/sidebar-content.php b/wp-content/themes/twentyfourteen/sidebar-content.php index 4a50ef01bc..5b3d5694a1 100644 --- a/wp-content/themes/twentyfourteen/sidebar-content.php +++ b/wp-content/themes/twentyfourteen/sidebar-content.php @@ -1,9 +1,10 @@
diff --git a/wp-content/themes/twentyfourteen/single.php b/wp-content/themes/twentyfourteen/single.php index 3ad86bbe50..4fe025d03e 100644 --- a/wp-content/themes/twentyfourteen/single.php +++ b/wp-content/themes/twentyfourteen/single.php @@ -1,9 +1,10 @@ diff --git a/wp-content/themes/twentyfourteen/tag.php b/wp-content/themes/twentyfourteen/tag.php index 8b58291680..e581853403 100644 --- a/wp-content/themes/twentyfourteen/tag.php +++ b/wp-content/themes/twentyfourteen/tag.php @@ -1,13 +1,14 @@ diff --git a/wp-content/themes/twentyfourteen/taxonomy-post_format.php b/wp-content/themes/twentyfourteen/taxonomy-post_format.php index bf3f279d32..718d3eb4a5 100644 --- a/wp-content/themes/twentyfourteen/taxonomy-post_format.php +++ b/wp-content/themes/twentyfourteen/taxonomy-post_format.php @@ -1,15 +1,16 @@