Make WordPress Core

Ticket #30149: 30149.5.diff

File 30149.5.diff, 9.1 KB (added by DrewAPicture, 10 years ago)

functionality docs

  • src/wp-content/themes/twentyfifteen/functions.php

     
    147147 *
    148148 * @since Twenty Fifteen 1.0
    149149 *
    150  * @return string
     150 * @return string Google fonts URL for the theme.
    151151 */
    152152function twentyfifteen_fonts_url() {
    153153        $fonts   = array();
     
    245245 * Add featured image as background image to post navigation elements.
    246246 *
    247247 * @since Twenty Fifteen 1.0
     248 *
     249 * @see wp_add_inline_style()
    248250 */
    249251function twentyfifteen_post_nav_background() {
    250252        if ( ! is_single() ) {
     
    290292 * @param WP_Post $item        Menu item object.
    291293 * @param int     $depth       Depth of the menu.
    292294 * @param array   $args        wp_nav_menu() arguments.
    293  *
    294295 * @return string Menu item with possible description.
    295296 */
    296297function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) {
     
    307308 *
    308309 * @since Twenty Fifteen 1.0
    309310 *
    310  * @param string $html Search form HTML
    311  *
    312  * @return string Modified search form HTML
     311 * @param string $html Search form HTML.
     312 * @return string Modified search form HTML.
    313313 */
    314314function twentyfifteen_search_form_modify( $html ) {
    315315        return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );
  • src/wp-content/themes/twentyfifteen/inc/back-compat.php

     
    11<?php
    22/**
    3  * Twenty Fifteen back compat functionality.
     3 * Twenty Fifteen back compat functionality
    44 *
    55 * Prevents Twenty Fifteen from running on WordPress versions prior to 4.1,
    6  * since this theme is not meant to be backward compatible beyond that
    7  * and relies on many newer functions and markup changes introduced in 4.1.
     6 * since this theme is not meant to be backward compatible beyond that and
     7 * relies on many newer functions and markup changes introduced in 4.1.
    88 *
    99 * @package WordPress
    1010 * @subpackage Twenty_Fifteen
     
    6060                wp_die( sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ) );
    6161        }
    6262}
    63 add_action( 'template_redirect', 'twentyfifteen_preview' );
    64  No newline at end of file
     63add_action( 'template_redirect', 'twentyfifteen_preview' );
  • src/wp-content/themes/twentyfifteen/inc/custom-header.php

     
    11<?php
    22/**
    3  * Implement Custom Header functionality for Twenty Fifteen.
     3 * Custom Header functionality for Twenty Fifteen
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Fifteen
     
    1010/**
    1111 * Set up the WordPress core custom header feature.
    1212 *
    13  * @uses twentyfifteen_header_style()
    14  * @uses twentyfifteen_admin_header_image()
     13 * @see twentyfifteen_header_style(), twentyfifteen_admin_header_image()
    1514 */
    1615function twentyfifteen_custom_header_setup() {
    1716        $color_scheme        = twentyfifteen_get_color_scheme();
     
    5049 * @since Twenty Fifteen 1.0
    5150 *
    5251 * @param string $color The original color, in 3- or 6-digit hexadecimal form.
    53  * @return array
     52 * @return array Array containing RGB (red, green, and blue) values for the given
     53 *               HEX code, empty array otherwise.
    5454 */
    5555function twentyfifteen_hex2rgb( $color ) {
    5656        $color = trim( $color, '#' );
     
    7575 * Styles the header image and text displayed on the blog.
    7676 *
    7777 * @since Twenty Fifteen 1.0
    78  * @see twentyfifteen_custom_header_setup().
     78 *
     79 * @see twentyfifteen_custom_header_setup()
    7980 */
    8081function twentyfifteen_header_style() {
    8182        $header_image = get_header_image();
     
    135136 * Custom header image markup displayed on the Appearance > Header admin panel.
    136137 *
    137138 * @since Twenty Fifteen 1.0
    138  * @see twentyfifteen_custom_header_setup().
     139 *
     140 * @see twentyfifteen_custom_header_setup()
    139141 */
    140142function twentyfifteen_admin_header_image() {
    141143        $style                   = sprintf( ' style="color: #%s;"', esc_attr( get_header_textcolor() ) );
     
    154156 * Enqueues front-end CSS for the header background color.
    155157 *
    156158 * @since Twenty Fifteen 1.0
     159 *
     160 * @see wp_add_inline_style()
    157161 */
    158162function twentyfifteen_header_background_color_css() {
    159163        $color_scheme            = twentyfifteen_get_color_scheme();
  • src/wp-content/themes/twentyfifteen/inc/customizer.php

     
    11<?php
    22/**
    3  * Twenty Fifteen Customizer.
     3 * Twenty Fifteen Customizer functionality
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Fifteen
     
    7676
    7777/**
    7878 * Register color schemes for Twenty Fifteen.
    79  * Can be filtered with twentyfifteen_color_schemes.
    8079 *
     80 * Can be filtered with {@see 'twentyfifteen_color_schemes'}.
     81 *
    8182 * The order of colors in a colors array:
    8283 * 1. Main Background Color.
    8384 * 2. Sidebar Background Color.
     
    163164
    164165if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) :
    165166/**
    166  * Returns an array of either the current or default color scheme hex values.
     167 * Get the current Twenty Fifteen color scheme.
    167168 *
    168169 * @since Twenty Fifteen 1.0
    169170 *
    170  * @return array
     171 * @return array An associative array of either the current or default color scheme hex values.
    171172 */
    172173function twentyfifteen_get_color_scheme() {
    173174        $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
     
    187188 *
    188189 * @since Twenty Fifteen 1.0
    189190 *
    190  * @return array
     191 * @return array Array of color schemes.
    191192 */
    192193function twentyfifteen_get_color_scheme_choices() {
    193194        $color_schemes                = twentyfifteen_get_color_schemes();
     
    208209 * @since Twenty Fifteen 1.0
    209210 *
    210211 * @param string $value Color scheme name value.
    211  *
    212212 * @return string Color scheme name.
    213213 */
    214214function twentyfifteen_sanitize_color_scheme( $value ) {
     
    226226 * Enqueues front-end CSS for color scheme.
    227227 *
    228228 * @since Twenty Fifteen 1.0
     229 *
     230 * @see wp_add_inline_style()
    229231 */
    230232function twentyfifteen_color_scheme_css() {
    231233        $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
     
    242244
    243245/**
    244246 * Binds JS listener to make Customizer color_scheme control.
     247 *
    245248 * Passes color scheme data as colorScheme global.
    246249 *
    247250 * @since Twenty Fifteen 1.0
     
    265268/**
    266269 * Output an Underscore template for generating CSS for the color scheme.
    267270 *
    268  * The template generates the css dynamically for instant display in the Customizer preview,
    269  * and to be saved in a `theme_mod` for display on the front-end.
     271 * The template generates the css dynamically for instant display in the Customizer
     272 * preview, and to be saved in a `theme_mod` for display on the front-end.
    270273 *
    271274 * @since Twenty Fifteen 1.0
    272275 */
  • src/wp-content/themes/twentyfifteen/inc/template-tags.php

     
    11<?php
    22/**
    3  * Custom template tags for this theme.
     3 * Custom template tags for Twenty Fifteen
    44 *
    55 * Eventually, some of the functionality here could be replaced by core features.
    66 *
     
    126126endif;
    127127
    128128/**
    129  * Returns true if a blog has more than 1 category.
     129 * Determine whether blog/site has more than one category.
    130130 *
    131131 * @since Twenty Fifteen 1.0
    132132 *
    133  * @return bool
     133 * @return bool True of there is more than one category, false otherwise.
    134134 */
    135135function twentyfifteen_categorized_blog() {
    136136        if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) {
     
    159159}
    160160
    161161/**
    162  * Flush out the transients used in twentyfifteen_categorized_blog.
     162 * Flush out the transients used in {@see twentyfifteen_categorized_blog()}.
    163163 *
    164164 * @since Twenty Fifteen 1.0
    165165 */
     
    210210 * Falls back to the post permalink if no URL is found in the post.
    211211 *
    212212 * @since Twenty Fifteen 1.0
    213  * @uses get_url_in_content()
    214213 *
     214 * @see get_url_in_content()
     215 *
    215216 * @return string The Link format URL.
    216217 */
    217218function twentyfifteen_get_link_url() {
     
    223224
    224225if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) :
    225226/**
    226  * Replaces "[...]" (appended to automatically generated excerpts) with ... and a Continue reading link.
     227 * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link.
    227228 *
    228229 * @since Twenty Fifteen 1.0
    229230 *
     231 * @return string 'Continue reading' link prepended with an ellipsis.
    230232 */
    231233function twentyfifteen_excerpt_more( $more ) {
    232234        $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',