From bd150bd8d6f3d4e50049e54905840c600544e130 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 25 Sep 2013 16:49:36 +0000 Subject: [PATCH] Twenty Eleven: update code comments to reflect WP inline docs standards. Props DrewAPicture, see #25256. git-svn-id: https://develop.svn.wordpress.org/trunk@25625 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyeleven/404.php | 2 +- .../themes/twentyeleven/archive.php | 4 +- src/wp-content/themes/twentyeleven/author.php | 28 +++- .../themes/twentyeleven/category.php | 15 +- .../themes/twentyeleven/comments.php | 11 +- .../themes/twentyeleven/content-aside.php | 6 +- .../themes/twentyeleven/content-featured.php | 2 +- .../themes/twentyeleven/content-gallery.php | 6 +- .../themes/twentyeleven/content-image.php | 6 +- .../themes/twentyeleven/content-intro.php | 2 +- .../themes/twentyeleven/content-link.php | 6 +- .../themes/twentyeleven/content-page.php | 2 +- .../themes/twentyeleven/content-quote.php | 2 +- .../themes/twentyeleven/content-single.php | 5 +- .../themes/twentyeleven/content-status.php | 20 ++- .../themes/twentyeleven/content.php | 2 +- src/wp-content/themes/twentyeleven/footer.php | 5 +- .../themes/twentyeleven/functions.php | 138 +++++++++++++----- src/wp-content/themes/twentyeleven/header.php | 24 +-- src/wp-content/themes/twentyeleven/image.php | 9 +- .../themes/twentyeleven/inc/theme-options.php | 103 ++++++++++--- .../themes/twentyeleven/inc/widgets.php | 30 +++- src/wp-content/themes/twentyeleven/index.php | 2 +- src/wp-content/themes/twentyeleven/page.php | 2 +- src/wp-content/themes/twentyeleven/search.php | 8 +- .../themes/twentyeleven/searchform.php | 2 +- .../themes/twentyeleven/showcase.php | 3 +- .../themes/twentyeleven/sidebar-footer.php | 5 +- .../themes/twentyeleven/sidebar-page.php | 3 +- .../themes/twentyeleven/sidebar.php | 2 +- src/wp-content/themes/twentyeleven/single.php | 2 +- src/wp-content/themes/twentyeleven/tag.php | 18 ++- 32 files changed, 350 insertions(+), 125 deletions(-) diff --git a/src/wp-content/themes/twentyeleven/404.php b/src/wp-content/themes/twentyeleven/404.php index 03e0651279..ae0ad04800 100644 --- a/src/wp-content/themes/twentyeleven/404.php +++ b/src/wp-content/themes/twentyeleven/404.php @@ -1,6 +1,6 @@ @@ -29,7 +30,8 @@ get_header(); ?> if ( get_the_author_meta( 'description' ) ) : ?>
- +

@@ -56,7 +67,8 @@ get_header(); ?> ' . $category_description . '
' ); + } ?> @@ -32,7 +40,8 @@ get_header(); ?>

diff --git a/src/wp-content/themes/twentyeleven/content-aside.php b/src/wp-content/themes/twentyeleven/content-aside.php index 66f06037e1..e3e7334c83 100644 --- a/src/wp-content/themes/twentyeleven/content-aside.php +++ b/src/wp-content/themes/twentyeleven/content-aside.php @@ -1,8 +1,10 @@
- +

diff --git a/src/wp-content/themes/twentyeleven/content-status.php b/src/wp-content/themes/twentyeleven/content-status.php index 144d12262d..4d987d9592 100644 --- a/src/wp-content/themes/twentyeleven/content-status.php +++ b/src/wp-content/themes/twentyeleven/content-status.php @@ -1,11 +1,14 @@ @@ -29,7 +32,18 @@
-
+
+ +
→', 'twentyeleven' ) ); ?> '' ) ); ?> diff --git a/src/wp-content/themes/twentyeleven/content.php b/src/wp-content/themes/twentyeleven/content.php index cc8532c998..1f5e50faee 100644 --- a/src/wp-content/themes/twentyeleven/content.php +++ b/src/wp-content/themes/twentyeleven/content.php @@ -1,6 +1,6 @@ $default_background_color, ) ); @@ -118,7 +122,21 @@ function twentyeleven_setup() { // The default header text color. 'default-text-color' => '000', // The height and width of our custom header. + /** + * Filter the Twenty Eleven default header image width. + * + * @since Twenty Eleven 1.0 + * + * @param int The default header image width in pixels. Default 1000. + */ 'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ), + /** + * Filter the Twenty Eleven default header image height. + * + * @since Twenty Eleven 1.0 + * + * @param int The default header image height in pixels. Default 288. + */ 'height' => apply_filters( 'twentyeleven_header_image_height', 288 ), // Support flexible heights. 'flex-height' => true, @@ -144,13 +162,17 @@ function twentyeleven_setup() { add_custom_background(); } - // We'll be using post thumbnails for custom header images on posts and pages. - // We want them to be the size of the header image that we just defined - // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. + /** + * We'll be using post thumbnails for custom header images on posts and pages. + * We want them to be the size of the header image that we just defined. + * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. + */ set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); - // Add Twenty Eleven's custom image sizes. - // Used for large feature (header) images. + /** + * Add Twenty Eleven's custom image sizes. + * Used for large feature (header) images. + */ add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true ); // Used for featured posts if a large-feature doesn't exist. add_image_size( 'small-feature', 500, 300 ); @@ -211,7 +233,7 @@ endif; // twentyeleven_setup if ( ! function_exists( 'twentyeleven_header_style' ) ) : /** - * Styles the header image and text displayed on the blog + * Styles the header image and text displayed on the blog. * * @since Twenty Eleven 1.0 */ @@ -327,10 +349,16 @@ function twentyeleven_admin_header_image() { ?> endif; // twentyeleven_admin_header_image /** - * Sets the post excerpt length to 40 words. + * Set the post excerpt length to 40 words. * - * To override this length in a child theme, remove the filter and add your own - * function tied to the excerpt_length filter hook. + * To override this length in a child theme, remove + * the filter and add your own function tied to + * the excerpt_length filter hook. + * + * @since Twenty Eleven 1.0 + * + * @param int $length The number of excerpt characters. + * @return int The filtered number of characters. */ function twentyeleven_excerpt_length( $length ) { return 40; @@ -339,7 +367,11 @@ add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' ); if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) : /** - * Returns a "Continue Reading" link for excerpts + * Return a "Continue Reading" link for excerpts + * + * @since Twenty Eleven 1.0 + * + * @return string The "Continue Reading" HTML link. */ function twentyeleven_continue_reading_link() { return ' ' . __( 'Continue reading ', 'twentyeleven' ) . ''; @@ -347,10 +379,17 @@ function twentyeleven_continue_reading_link() { endif; // twentyeleven_continue_reading_link /** - * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link(). + * Replace "[...]" in the Read More link with an ellipsis. + * + * The "[...]" is appended to automatically generated excerpts. * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. + * + * @since Twenty Eleven 1.0 + * + * @param string $more The Read More text. + * @return The filtered Read More text. */ function twentyeleven_auto_excerpt_more( $more ) { return ' …' . twentyeleven_continue_reading_link(); @@ -358,10 +397,15 @@ function twentyeleven_auto_excerpt_more( $more ) { add_filter( 'excerpt_more', 'twentyeleven_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 Eleven 1.0 + * + * @param string $output The "Continue Reading" link. + * @return string The filtered "Continue Reading" link. */ function twentyeleven_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { @@ -372,7 +416,12 @@ function twentyeleven_custom_excerpt_more( $output ) { add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' ); /** - * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. + * Show a home link for the wp_nav_menu() fallback, wp_page_menu(). + * + * @since Twenty Eleven 1.0 + * + * @param array $args The page menu arguments. @see wp_page_menu() + * @return array The filtered page menu arguments. */ function twentyeleven_page_menu_args( $args ) { if ( ! isset( $args['show_home'] ) ) @@ -382,7 +431,9 @@ function twentyeleven_page_menu_args( $args ) { add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' ); /** - * Register our sidebars and widgetized areas. Also register the default Epherma widget. + * Register sidebars and widgetized areas. + * + * Also register the default Epherma widget. * * @since Twenty Eleven 1.0 */ @@ -443,7 +494,11 @@ add_action( 'widgets_init', 'twentyeleven_widgets_init' ); if ( ! function_exists( 'twentyeleven_content_nav' ) ) : /** - * Display navigation to next/previous pages when applicable + * Display navigation to next/previous pages when applicable. + * + * @since Twenty Eleven 1.0 + * + * @param string $html_id The HTML id attribute. */ function twentyeleven_content_nav( $html_id ) { global $wp_query; @@ -462,9 +517,11 @@ endif; // twentyeleven_content_nav * Return the first link from the post content. If none found, the * post permalink is used as a fallback. * + * @since Twenty Eleven 1.0 + * * @uses get_url_in_content() to get the first URL from the post content. * - * @return string + * @return string The first link. */ function twentyeleven_get_first_url() { $content = get_the_content(); @@ -473,6 +530,7 @@ function twentyeleven_get_first_url() { if ( ! $has_url ) $has_url = twentyeleven_url_grabber(); + //duplicate_hook return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } @@ -480,6 +538,7 @@ function twentyeleven_get_first_url() { * Return the URL for the first link found in the post content. * * @since Twenty Eleven 1.0 + * * @return string|bool URL or false when no link is present. */ function twentyeleven_url_grabber() { @@ -490,7 +549,9 @@ function twentyeleven_url_grabber() { } /** - * Count the number of footer sidebars to enable dynamic classes for the footer + * Count the number of footer sidebars to enable dynamic classes for the footer. + * + * @since Twenty Eleven 1.0 */ function twentyeleven_footer_sidebar_class() { $count = 0; @@ -532,6 +593,10 @@ if ( ! function_exists( 'twentyeleven_comment' ) ) : * Used as a callback by wp_list_comments() for displaying the comments. * * @since Twenty Eleven 1.0 + * + * @param object $comment The comment object. + * @param array $args An array of comment arguments. @see get_comment_reply_link() + * @param int $depth The depth of the comment. */ function twentyeleven_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; @@ -593,7 +658,8 @@ endif; // ends check for twentyeleven_comment() if ( ! function_exists( 'twentyeleven_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. + * * Create your own twentyeleven_posted_on to override in a child theme * * @since Twenty Eleven 1.0 @@ -612,11 +678,15 @@ function twentyeleven_posted_on() { endif; /** - * Adds two classes to the array of body classes. + * Add two classes to the array of body classes. + * * The first is if the site has only had one author with published posts. * The second is if a singular post being displayed * * @since Twenty Eleven 1.0 + * + * @param array $classes Existing body classes. + * @return array The filtered array of body classes. */ function twentyeleven_body_classes( $classes ) { @@ -631,10 +701,10 @@ function twentyeleven_body_classes( $classes ) { add_filter( 'body_class', 'twentyeleven_body_classes' ); /** - * Retrieves the IDs for images in a gallery. + * Retrieve the IDs for images in a gallery. * - * @uses get_post_galleries() first, if available. Falls back to shortcode parsing, - * then as last option uses a get_posts() call. + * @uses get_post_galleries() First, if available. Falls back to shortcode parsing, + * then as last option uses a get_posts() call. * * @since Twenty Eleven 1.6. * diff --git a/src/wp-content/themes/twentyeleven/header.php b/src/wp-content/themes/twentyeleven/header.php index 59b6d3b140..199c409cce 100644 --- a/src/wp-content/themes/twentyeleven/header.php +++ b/src/wp-content/themes/twentyeleven/header.php @@ -1,8 +1,8 @@ section and everything up till
+ * Displays all of the section and everything up till
. * * @package WordPress * @subpackage Twenty_Eleven @@ -25,7 +25,7 @@ <?php - /* + /** * Print the <title> tag based on what is being viewed. */ global $page, $paged; @@ -52,13 +52,15 @@ <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script> <![endif]--> <?php - /* We add some JavaScript to pages with the comment form + /** + * We add some JavaScript to pages with the comment form * to support sites with threaded comments (when in use). */ if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); - /* Always have wp_head() just before the closing </head> + /** + * Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. @@ -81,8 +83,10 @@ if ( $header_image ) : // Compatibility with versions of WordPress prior to 3.4. if ( function_exists( 'get_custom_header' ) ) { - // We need to figure out what the minimum width should be for our featured image. - // This result would be the suggested width if the theme were to implement flexible widths. + /** + * We need to figure out what the minimum width should be for our featured image. + * This result would be the suggested width if the theme were to implement flexible widths. + */ $header_image_width = get_theme_support( 'custom-header', 'width' ); } else { $header_image_width = HEADER_IMAGE_WIDTH; @@ -90,8 +94,10 @@ ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <?php - // The header image - // Check if this is a post or page, if it has a thumbnail, and if it's a big one + /** + * The header image. + * Check if this is a post or page, if it has a thumbnail, and if it's a big one + */ if ( is_singular() && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && $image[1] >= $header_image_width ) : diff --git a/src/wp-content/themes/twentyeleven/image.php b/src/wp-content/themes/twentyeleven/image.php index 3db208ef36..8ce0cf593a 100644 --- a/src/wp-content/themes/twentyeleven/image.php +++ b/src/wp-content/themes/twentyeleven/image.php @@ -1,6 +1,6 @@ <?php /** - * The template for displaying image attachments. + * Template for displaying image attachments * * @package WordPress * @subpackage Twenty_Eleven @@ -72,6 +72,13 @@ get_header(); ?> } ?> <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php + /** + * Filter the Twenty Eleven default attachment size. + * + * @since Twenty Eleven 1.0 + * + * @param int The height and width attachment size dimensions in pixels. Default 848. + */ $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 ); echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height. ?></a> diff --git a/src/wp-content/themes/twentyeleven/inc/theme-options.php b/src/wp-content/themes/twentyeleven/inc/theme-options.php index 698f2a0b5e..91e81c220d 100644 --- a/src/wp-content/themes/twentyeleven/inc/theme-options.php +++ b/src/wp-content/themes/twentyeleven/inc/theme-options.php @@ -14,6 +14,7 @@ * * @since Twenty Eleven 1.0 * + * @param string $hook_suffix An admin page's hook suffix. */ function twentyeleven_admin_enqueue_scripts( $hook_suffix ) { wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' ); @@ -51,11 +52,11 @@ function twentyeleven_theme_options_init() { // Register our individual settings fields add_settings_field( - 'color_scheme', // Unique identifier for the field for this section - __( 'Color Scheme', 'twentyeleven' ), // Setting field label + 'color_scheme', // Unique identifier for the field for this section + __( 'Color Scheme', 'twentyeleven' ), // Setting field label 'twentyeleven_settings_field_color_scheme', // Function that renders the settings field - 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() - 'general' // Settings section. Same as the first argument in the add_settings_section() above + 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() + 'general' // Settings section. Same as the first argument in the add_settings_section() above ); add_settings_field( 'link_color', __( 'Link Color', 'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' ); @@ -66,7 +67,7 @@ add_action( 'admin_init', 'twentyeleven_theme_options_init' ); /** * Change the capability required to save the 'twentyeleven_options' options group. * - * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group. + * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group. * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page. * * By default, the options groups for all registered settings require the manage_options capability. @@ -83,7 +84,7 @@ function twentyeleven_option_page_capability( $capability ) { add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' ); /** - * Add our theme options page to the admin menu, including some help documentation. + * Add a theme options page to the admin menu, including some help documentation. * * This function is attached to the admin_menu action hook. * @@ -122,7 +123,7 @@ function twentyeleven_theme_options_help() { $screen = get_current_screen(); if ( method_exists( $screen, 'add_help_tab' ) ) { - // WordPress 3.3 + // WordPress 3.3.0 $screen->add_help_tab( array( 'title' => __( 'Overview', 'twentyeleven' ), 'id' => 'theme-options-help', @@ -132,13 +133,13 @@ function twentyeleven_theme_options_help() { $screen->set_help_sidebar( $sidebar ); } else { - // WordPress 3.2 + // WordPress 3.2.0 add_contextual_help( $screen, $help . $sidebar ); } } /** - * Returns an array of color schemes registered for Twenty Eleven. + * Return an array of color schemes registered for Twenty Eleven. * * @since Twenty Eleven 1.0 */ @@ -158,11 +159,18 @@ function twentyeleven_color_schemes() { ), ); + /** + * Filter the Twenty Eleven color scheme options. + * + * @since Twenty Eleven 1.0 + * + * @param array $color_scheme_options An associative array of color scheme options. + */ return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options ); } /** - * Returns an array of layout options registered for Twenty Eleven. + * Return an array of layout options registered for Twenty Eleven. * * @since Twenty Eleven 1.0 */ @@ -185,13 +193,22 @@ function twentyeleven_layouts() { ), ); + /** + * Filter the Twenty Eleven layout options. + * + * @since Twenty Eleven 1.0 + * + * @param array $layout_options An associative array of layout options. + */ return apply_filters( 'twentyeleven_layouts', $layout_options ); } /** - * Returns the default options for Twenty Eleven. + * Return the default options for Twenty Eleven. * * @since Twenty Eleven 1.0 + * + * @return array An array of default theme options. */ function twentyeleven_get_default_theme_options() { $default_theme_options = array( @@ -203,16 +220,24 @@ function twentyeleven_get_default_theme_options() { if ( is_rtl() ) $default_theme_options['theme_layout'] = 'sidebar-content'; + /** + * Filter the Twenty Eleven default options. + * + * @since Twenty Eleven 1.0 + * + * @param array $default_theme_options An array of default theme options. + */ return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options ); } /** - * Returns the default link color for Twenty Eleven, based on color scheme. + * Return the default link color for Twenty Eleven, based on color scheme. * * @since Twenty Eleven 1.0 * - * @param $string $color_scheme Color scheme. Defaults to the active color scheme. - * @return $string Color. + * @param string $color_scheme Optional. Color scheme. + * Default null (or the active color scheme). + * @return string The default link color. */ function twentyeleven_get_default_link_color( $color_scheme = null ) { if ( null === $color_scheme ) { @@ -228,7 +253,7 @@ function twentyeleven_get_default_link_color( $color_scheme = null ) { } /** - * Returns the options array for Twenty Eleven. + * Return the options array for Twenty Eleven. * * @since Twenty Eleven 1.0 */ @@ -237,7 +262,7 @@ function twentyeleven_get_theme_options() { } /** - * Renders the Color Scheme setting field. + * Render the Color Scheme setting field. * * @since Twenty Eleven 1.3 */ @@ -261,7 +286,7 @@ function twentyeleven_settings_field_color_scheme() { } /** - * Renders the Link Color setting field. + * Render the Link Color setting field. * * @since Twenty Eleven 1.3 */ @@ -278,7 +303,7 @@ function twentyeleven_settings_field_link_color() { } /** - * Renders the Layout setting field. + * Render the Layout setting field. * * @since Twenty Eleven 1.3 */ @@ -300,7 +325,7 @@ function twentyeleven_settings_field_layout() { } /** - * Returns the options array for Twenty Eleven. + * Return the options array for Twenty Eleven. * * @since Twenty Eleven 1.2 */ @@ -324,12 +349,16 @@ function twentyeleven_theme_options_render_page() { } /** - * Sanitize and validate form input. Accepts an array, return a sanitized array. + * Sanitize and validate form input. + * + * Accepts an array, return a sanitized array. * * @see twentyeleven_theme_options_init() * @todo set up Reset Options action * * @since Twenty Eleven 1.0 + * + * @param array $input An array of form input. */ function twentyeleven_theme_options_validate( $input ) { $output = $defaults = twentyeleven_get_default_theme_options(); @@ -349,6 +378,15 @@ function twentyeleven_theme_options_validate( $input ) { if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) $output['theme_layout'] = $input['theme_layout']; + /** + * Filter the Twenty Eleven sanitized form input array. + * + * @since Twenty Eleven 1.0 + * + * @param array $output An array of sanitized form output. + * @param array $input An array of un-sanitized form input. + * @param array $defaults An array of default theme options. + */ return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults ); } @@ -364,6 +402,13 @@ function twentyeleven_enqueue_color_scheme() { if ( 'dark' == $color_scheme ) wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null ); + /** + * Fires after the styles for the Twenty Eleven color scheme are enqueued. + * + * @since Twenty Eleven 1.0 + * + * @param string $color_scheme The color scheme. + */ do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme ); } add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' ); @@ -417,9 +462,11 @@ function twentyeleven_print_link_color_style() { add_action( 'wp_head', 'twentyeleven_print_link_color_style' ); /** - * Adds Twenty Eleven layout classes to the array of body classes. + * Add Twenty Eleven layout classes to the array of body classes. * * @since Twenty Eleven 1.0 + * + * @param array $existing_classes An array of existing body classes. */ function twentyeleven_layout_classes( $existing_classes ) { $options = twentyeleven_get_theme_options(); @@ -437,6 +484,14 @@ function twentyeleven_layout_classes( $existing_classes ) { else $classes[] = $current_layout; + /** + * Filter the Twenty Eleven layout body classes. + * + * @since Twenty Eleven 1.0 + * + * @param array $classes An array of body classes. + * @param string $current_layout The current theme layout. + */ $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout ); return array_merge( $existing_classes, $classes ); @@ -446,10 +501,11 @@ add_filter( 'body_class', 'twentyeleven_layout_classes' ); /** * Implements Twenty Eleven theme options into Theme Customizer * - * @param $wp_customize Theme Customizer object + * @since Twenty Eleven 1.3 + * + * @param object $wp_customize Theme Customizer object. * @return void * - * @since Twenty Eleven 1.3 */ function twentyeleven_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; @@ -521,6 +577,7 @@ add_action( 'customize_register', 'twentyeleven_customize_register' ); /** * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. + * * Used with blogname and blogdescription. * * @since Twenty Eleven 1.3 diff --git a/src/wp-content/themes/twentyeleven/inc/widgets.php b/src/wp-content/themes/twentyeleven/inc/widgets.php index 2571274f6c..9e9c1f4ce3 100644 --- a/src/wp-content/themes/twentyeleven/inc/widgets.php +++ b/src/wp-content/themes/twentyeleven/inc/widgets.php @@ -1,8 +1,10 @@ <?php /** - * Makes a custom Widget for displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven + * Widget For displaying post format posts * - * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets + * Handles displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven. + * + * @link http://codex.wordpress.org/Widgets_API#Developing_Widgets * * @package WordPress * @subpackage Twenty_Eleven @@ -13,6 +15,8 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { /** * Constructor * + * @since Twenty Eleven 1.0 + * * @return void **/ function Twenty_Eleven_Ephemera_Widget() { @@ -28,9 +32,11 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { /** * Outputs the HTML for this widget. * - * @param array An array of standard parameters for widgets in this theme - * @param array An array of settings for this widget instance - * @return void Echoes its output + * @since Twenty Eleven 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. + * @return void **/ function widget( $args, $instance ) { $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); @@ -49,6 +55,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { ob_start(); extract( $args, EXTR_SKIP ); + //duplicate_hook $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base); if ( ! isset( $instance['number'] ) ) @@ -120,8 +127,12 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { } /** + * Update widget settings. + * * Deals with the settings when they are saved by the admin. Here is * where any validation should be dealt with. + * + * @since Twenty Eleven 1.0 **/ function update( $new_instance, $old_instance ) { $instance = $old_instance; @@ -136,12 +147,21 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { return $instance; } + /** + * Flush widget cache. + * + * @since Twenty Eleven 1.0 + */ function flush_widget_cache() { wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' ); } /** + * Set up the widget form. + * * Displays the form for this widget on the Widgets page of the WP Admin area. + * + * @since Twenty Eleven 1.0 **/ function form( $instance ) { $title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : ''; diff --git a/src/wp-content/themes/twentyeleven/index.php b/src/wp-content/themes/twentyeleven/index.php index f955f34991..77ac27d4c9 100644 --- a/src/wp-content/themes/twentyeleven/index.php +++ b/src/wp-content/themes/twentyeleven/index.php @@ -1,6 +1,6 @@ <?php /** - * The main template file. + * Main template file * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). diff --git a/src/wp-content/themes/twentyeleven/page.php b/src/wp-content/themes/twentyeleven/page.php index 5dda4d164f..349810704a 100644 --- a/src/wp-content/themes/twentyeleven/page.php +++ b/src/wp-content/themes/twentyeleven/page.php @@ -1,6 +1,6 @@ <?php /** - * The template for displaying all pages. + * Template for displaying all pages * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages diff --git a/src/wp-content/themes/twentyeleven/search.php b/src/wp-content/themes/twentyeleven/search.php index bf45c2feeb..97f74206ed 100644 --- a/src/wp-content/themes/twentyeleven/search.php +++ b/src/wp-content/themes/twentyeleven/search.php @@ -1,6 +1,6 @@ <?php /** - * The template for displaying Search Results pages. + * Template for displaying Search Results pages * * @package WordPress * @subpackage Twenty_Eleven @@ -24,9 +24,11 @@ get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php - /* Include the Post-Format-specific template for the content. + /** + * Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file - * called content-___.php (where ___ is the Post Format name) and that will be used instead. + * called content-___.php (where ___ is the Post Format name) and that + * will be used instead. */ get_template_part( 'content', get_post_format() ); ?> diff --git a/src/wp-content/themes/twentyeleven/searchform.php b/src/wp-content/themes/twentyeleven/searchform.php index b83ec1e67f..bd8cdca1b4 100644 --- a/src/wp-content/themes/twentyeleven/searchform.php +++ b/src/wp-content/themes/twentyeleven/searchform.php @@ -1,6 +1,6 @@ <?php /** - * The template for displaying search forms in Twenty Eleven + * Template for displaying search forms in Twenty Eleven * * @package WordPress * @subpackage Twenty_Eleven diff --git a/src/wp-content/themes/twentyeleven/showcase.php b/src/wp-content/themes/twentyeleven/showcase.php index e514231898..00fc80c345 100644 --- a/src/wp-content/themes/twentyeleven/showcase.php +++ b/src/wp-content/themes/twentyeleven/showcase.php @@ -1,7 +1,8 @@ <?php /** * Template Name: Showcase Template - * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts + * + * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts. * * The showcase template in Twenty Eleven consists of a featured posts section using sticky posts, * another recent posts area (with the latest post shown in full and the rest as a list) diff --git a/src/wp-content/themes/twentyeleven/sidebar-footer.php b/src/wp-content/themes/twentyeleven/sidebar-footer.php index cbcb49b5de..25c82fc906 100644 --- a/src/wp-content/themes/twentyeleven/sidebar-footer.php +++ b/src/wp-content/themes/twentyeleven/sidebar-footer.php @@ -1,6 +1,6 @@ <?php /** - * The Footer widget areas. + * Footer widget areas * * @package WordPress * @subpackage Twenty_Eleven @@ -9,7 +9,8 @@ ?> <?php - /* The footer widget area is triggered if any of the areas + /** + * The footer widget area is triggered if any of the areas * have widgets. So let's check that first. * * If none of the sidebars have widgets, then let's bail early. diff --git a/src/wp-content/themes/twentyeleven/sidebar-page.php b/src/wp-content/themes/twentyeleven/sidebar-page.php index c10d628586..6fc3b86fed 100644 --- a/src/wp-content/themes/twentyeleven/sidebar-page.php +++ b/src/wp-content/themes/twentyeleven/sidebar-page.php @@ -1,7 +1,8 @@ <?php /** * Template Name: Sidebar Template - * Description: A Page Template that adds a sidebar to pages + * + * Description: A Page Template that adds a sidebar to pages. * * @package WordPress * @subpackage Twenty_Eleven diff --git a/src/wp-content/themes/twentyeleven/sidebar.php b/src/wp-content/themes/twentyeleven/sidebar.php index 0f0857181f..c9afedcdfc 100644 --- a/src/wp-content/themes/twentyeleven/sidebar.php +++ b/src/wp-content/themes/twentyeleven/sidebar.php @@ -1,6 +1,6 @@ <?php /** - * The Sidebar containing the main widget area. + * Sidebar containing the main widget area * * @package WordPress * @subpackage Twenty_Eleven diff --git a/src/wp-content/themes/twentyeleven/single.php b/src/wp-content/themes/twentyeleven/single.php index 92a533eb9c..861c50c439 100644 --- a/src/wp-content/themes/twentyeleven/single.php +++ b/src/wp-content/themes/twentyeleven/single.php @@ -1,6 +1,6 @@ <?php /** - * The Template for displaying all single posts. + * Template for displaying all single posts * * @package WordPress * @subpackage Twenty_Eleven diff --git a/src/wp-content/themes/twentyeleven/tag.php b/src/wp-content/themes/twentyeleven/tag.php index 8180a8cf49..8f50878386 100644 --- a/src/wp-content/themes/twentyeleven/tag.php +++ b/src/wp-content/themes/twentyeleven/tag.php @@ -1,6 +1,6 @@ <?php /** - * The template used to display Tag Archive pages + * Template used to display Tag Archive pages * * @package WordPress * @subpackage Twenty_Eleven @@ -21,8 +21,16 @@ get_header(); ?> <?php $tag_description = tag_description(); - if ( ! empty( $tag_description ) ) + if ( ! empty( $tag_description ) ) { + /** + * Filter the default Twenty Eleven tag description. + * + * @since Twenty Eleven 1.0 + * + * @param string The default tag description. + */ echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' ); + } ?> </header> @@ -32,9 +40,11 @@ get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php - /* Include the Post-Format-specific template for the content. + /** + * Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file - * called content-___.php (where ___ is the Post Format name) and that will be used instead. + * called content-___.php (where ___ is the Post Format name) and that + * will be used instead. */ get_template_part( 'content', get_post_format() ); ?>