Twenty Fifteen: docs correction and cleanup.

Props DrewAPicture, see #30149.


Built from https://develop.svn.wordpress.org/trunk@30569


git-svn-id: http://core.svn.wordpress.org/trunk@30559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ian Stewart 2014-11-25 20:57:24 +00:00
parent 7a643924c2
commit e11418abdc
6 changed files with 36 additions and 27 deletions

View File

@ -147,7 +147,7 @@ if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) :
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @return string * @return string Google fonts URL for the theme.
*/ */
function twentyfifteen_fonts_url() { function twentyfifteen_fonts_url() {
$fonts = array(); $fonts = array();
@ -245,6 +245,8 @@ add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' );
* Add featured image as background image to post navigation elements. * Add featured image as background image to post navigation elements.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*
* @see wp_add_inline_style()
*/ */
function twentyfifteen_post_nav_background() { function twentyfifteen_post_nav_background() {
if ( ! is_single() ) { if ( ! is_single() ) {
@ -290,7 +292,6 @@ add_action( 'wp_enqueue_scripts', 'twentyfifteen_post_nav_background' );
* @param WP_Post $item Menu item object. * @param WP_Post $item Menu item object.
* @param int $depth Depth of the menu. * @param int $depth Depth of the menu.
* @param array $args wp_nav_menu() arguments. * @param array $args wp_nav_menu() arguments.
*
* @return string Menu item with possible description. * @return string Menu item with possible description.
*/ */
function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) { function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) {
@ -307,9 +308,8 @@ add_filter( 'walker_nav_menu_start_el', 'twentyfifteen_nav_description', 10, 4 )
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @param string $html Search form HTML * @param string $html Search form HTML.
* * @return string Modified search form HTML.
* @return string Modified search form HTML
*/ */
function twentyfifteen_search_form_modify( $html ) { function twentyfifteen_search_form_modify( $html ) {
return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html ); return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );

View File

@ -1,10 +1,10 @@
<?php <?php
/** /**
* Twenty Fifteen back compat functionality. * Twenty Fifteen back compat functionality
* *
* Prevents Twenty Fifteen from running on WordPress versions prior to 4.1, * Prevents Twenty Fifteen from running on WordPress versions prior to 4.1,
* since this theme is not meant to be backward compatible beyond that * since this theme is not meant to be backward compatible beyond that and
* and relies on many newer functions and markup changes introduced in 4.1. * relies on many newer functions and markup changes introduced in 4.1.
* *
* @package WordPress * @package WordPress
* @subpackage Twenty_Fifteen * @subpackage Twenty_Fifteen

View File

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Implement Custom Header functionality for Twenty Fifteen. * Custom Header functionality for Twenty Fifteen
* *
* @package WordPress * @package WordPress
* @subpackage Twenty_Fifteen * @subpackage Twenty_Fifteen
@ -46,7 +46,8 @@ add_action( 'after_setup_theme', 'twentyfifteen_custom_header_setup' );
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @param string $color The original color, in 3- or 6-digit hexadecimal form. * @param string $color The original color, in 3- or 6-digit hexadecimal form.
* @return array * @return array Array containing RGB (red, green, and blue) values for the given
* HEX code, empty array otherwise.
*/ */
function twentyfifteen_hex2rgb( $color ) { function twentyfifteen_hex2rgb( $color ) {
$color = trim( $color, '#' ); $color = trim( $color, '#' );
@ -71,7 +72,8 @@ if ( ! function_exists( 'twentyfifteen_header_style' ) ) :
* Styles the header image and text displayed on the blog. * Styles the header image and text displayed on the blog.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* @see twentyfifteen_custom_header_setup(). *
* @see twentyfifteen_custom_header_setup()
*/ */
function twentyfifteen_header_style() { function twentyfifteen_header_style() {
$header_image = get_header_image(); $header_image = get_header_image();
@ -173,6 +175,8 @@ endif; // twentyfifteen_header_style
* Enqueues front-end CSS for the header background color. * Enqueues front-end CSS for the header background color.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*
* @see wp_add_inline_style()
*/ */
function twentyfifteen_header_background_color_css() { function twentyfifteen_header_background_color_css() {
$color_scheme = twentyfifteen_get_color_scheme(); $color_scheme = twentyfifteen_get_color_scheme();

View File

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Twenty Fifteen Customizer. * Twenty Fifteen Customizer functionality
* *
* @package WordPress * @package WordPress
* @subpackage Twenty_Fifteen * @subpackage Twenty_Fifteen
@ -76,7 +76,8 @@ add_action( 'customize_register', 'twentyfifteen_customize_register', 11 );
/** /**
* Register color schemes for Twenty Fifteen. * Register color schemes for Twenty Fifteen.
* Can be filtered with twentyfifteen_color_schemes. *
* Can be filtered with {@see 'twentyfifteen_color_schemes'}.
* *
* The order of colors in a colors array: * The order of colors in a colors array:
* 1. Main Background Color. * 1. Main Background Color.
@ -163,11 +164,11 @@ function twentyfifteen_get_color_schemes() {
if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) : if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) :
/** /**
* Returns an array of either the current or default color scheme hex values. * Get the current Twenty Fifteen color scheme.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @return array * @return array An associative array of either the current or default color scheme hex values.
*/ */
function twentyfifteen_get_color_scheme() { function twentyfifteen_get_color_scheme() {
$color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
@ -187,7 +188,7 @@ if ( ! function_exists( 'twentyfifteen_get_color_scheme_control_options' ) ) :
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @return array * @return array Array of color schemes.
*/ */
function twentyfifteen_get_color_scheme_choices() { function twentyfifteen_get_color_scheme_choices() {
$color_schemes = twentyfifteen_get_color_schemes(); $color_schemes = twentyfifteen_get_color_schemes();
@ -208,7 +209,6 @@ if ( ! function_exists( 'twentyfifteen_sanitize_color_scheme' ) ) :
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @param string $value Color scheme name value. * @param string $value Color scheme name value.
*
* @return string Color scheme name. * @return string Color scheme name.
*/ */
function twentyfifteen_sanitize_color_scheme( $value ) { function twentyfifteen_sanitize_color_scheme( $value ) {
@ -226,6 +226,8 @@ endif; // twentyfifteen_sanitize_color_scheme
* Enqueues front-end CSS for color scheme. * Enqueues front-end CSS for color scheme.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*
* @see wp_add_inline_style()
*/ */
function twentyfifteen_color_scheme_css() { function twentyfifteen_color_scheme_css() {
$color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
@ -242,6 +244,7 @@ add_action( 'wp_enqueue_scripts', 'twentyfifteen_color_scheme_css' );
/** /**
* Binds JS listener to make Customizer color_scheme control. * Binds JS listener to make Customizer color_scheme control.
*
* Passes color scheme data as colorScheme global. * Passes color scheme data as colorScheme global.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
@ -265,8 +268,8 @@ add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' );
/** /**
* Output an Underscore template for generating CSS for the color scheme. * Output an Underscore template for generating CSS for the color scheme.
* *
* The template generates the css dynamically for instant display in the Customizer preview, * The template generates the css dynamically for instant display in the Customizer
* and to be saved in a `theme_mod` for display on the front-end. * preview, and to be saved in a `theme_mod` for display on the front-end.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*/ */

View File

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Custom template tags for this theme. * Custom template tags for Twenty Fifteen
* *
* Eventually, some of the functionality here could be replaced by core features. * Eventually, some of the functionality here could be replaced by core features.
* *
@ -126,11 +126,11 @@ function twentyfifteen_entry_meta() {
endif; endif;
/** /**
* Returns true if a blog has more than 1 category. * Determine whether blog/site has more than one category.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @return bool * @return bool True of there is more than one category, false otherwise.
*/ */
function twentyfifteen_categorized_blog() { function twentyfifteen_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) { if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) {
@ -159,7 +159,7 @@ function twentyfifteen_categorized_blog() {
} }
/** /**
* Flush out the transients used in twentyfifteen_categorized_blog. * Flush out the transients used in {@see twentyfifteen_categorized_blog()}.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*/ */
@ -210,7 +210,8 @@ if ( ! function_exists( 'twentyfifteen_get_link_url' ) ) :
* Falls back to the post permalink if no URL is found in the post. * Falls back to the post permalink if no URL is found in the post.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* @uses get_url_in_content() *
* @see get_url_in_content()
* *
* @return string The Link format URL. * @return string The Link format URL.
*/ */
@ -223,10 +224,11 @@ endif;
if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) : if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) :
/** /**
* Replaces "[...]" (appended to automatically generated excerpts) with ... and a Continue reading link. * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link.
* *
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
* *
* @return string 'Continue reading' link prepended with an ellipsis.
*/ */
function twentyfifteen_excerpt_more( $more ) { function twentyfifteen_excerpt_more( $more ) {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-beta2-30568'; $wp_version = '4.1-beta2-30569';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.