+
+
→', 'twentyeleven' ) ); ?>
'' . __( 'Pages:', 'twentyeleven' ) . '', 'after' => '
' ) ); ?>
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 ';
@@ -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 ', 'twentyeleven' ) . '
+ * Displays all of the section and everything up till
.
*
* @package WordPress
* @subpackage Twenty_Eleven
@@ -25,7 +25,7 @@
tag based on what is being viewed.
*/
global $page, $paged;
@@ -52,13 +52,15 @@
+ /**
+ * Always have wp_head() just before the closing
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to 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 @@
?>
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 @@
}
?>
ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
?>
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 @@
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 @@
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 @@
' . $tag_description . '
' );
+ }
?>
@@ -32,9 +40,11 @@ get_header(); ?>