- Timestamp:
- 09/20/2013 07:33:23 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentythirteen/functions.php
r24934 r25522 1 1 <?php 2 2 /** 3 * Twenty Thirteen functions and definitions .3 * Twenty Thirteen functions and definitions 4 4 * 5 5 * Sets up the theme and provides some helper functions, which are used in the … … 17 17 * instead attached to a filter or action hook. 18 18 * 19 * For more information on hooks, actions, and filters, 20 * see http://codex.wordpress.org/Plugin_API 19 * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API 21 20 * 22 21 * @package WordPress … … 26 25 27 26 /** 28 * Sets up the content width value based on the theme's design. 27 * Set up the content width value based on the theme's design. 28 * 29 29 * @see twentythirteen_content_width() for template-specific adjustments. 30 30 */ … … 33 33 34 34 /** 35 * Add ssupport for a custom header image.35 * Add support for a custom header image. 36 36 */ 37 37 require get_template_directory() . '/inc/custom-header.php'; … … 44 44 45 45 /** 46 * Twenty Thirteen setup. 47 * 46 48 * Sets up theme defaults and registers the various WordPress features that 47 49 * Twenty Thirteen supports. … … 59 61 */ 60 62 function twentythirteen_setup() { 61 /* 63 /** 62 64 * Makes Twenty Thirteen available for translation. 63 65 * … … 69 71 load_theme_textdomain( 'twentythirteen', get_template_directory() . '/languages' ); 70 72 71 /* 73 /** 72 74 * This theme styles the visual editor to resemble the theme style, 73 75 * specifically font, colors, icons, and column width. … … 78 80 add_theme_support( 'automatic-feed-links' ); 79 81 80 // Switches default core markup for search form, comment form, and comments 81 // to output valid HTML5. 82 /** 83 * Switches default core markup for search form, comment form, 84 * and comments to output valid HTML5. 85 */ 82 86 add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) ); 83 87 84 /* 88 /** 85 89 * This theme supports all available post formats by default. 86 90 * See http://codex.wordpress.org/Post_Formats … … 93 97 register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) ); 94 98 95 /* 99 /** 96 100 * This theme uses a custom image size for featured images, displayed on 97 101 * "standard" posts and pages. … … 106 110 107 111 /** 108 * Return sthe Google font stylesheet URL, if available.112 * Return the Google font stylesheet URL, if available. 109 113 * 110 114 * The use of Source Sans Pro and Bitter by default is localized. For languages … … 118 122 $fonts_url = ''; 119 123 120 /* Translators: If there are characters in your language that are not 124 /** 125 * Translators: If there are characters in your language that are not 121 126 * supported by Source Sans Pro, translate this to 'off'. Do not translate 122 127 * into your own language. … … 124 129 $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'twentythirteen' ); 125 130 126 /* Translators: If there are characters in your language that are not 131 /** 132 * Translators: If there are characters in your language that are not 127 133 * supported by Bitter, translate this to 'off'. Do not translate into your 128 134 * own language. … … 150 156 151 157 /** 152 * Enqueue s scripts and styles forfront end.158 * Enqueue scripts and styles for the front end. 153 159 * 154 160 * @since Twenty Thirteen 1.0 … … 157 163 */ 158 164 function twentythirteen_scripts_styles() { 159 // Adds JavaScript to pages with the comment form to support sites with 160 // threaded comments (when in use). 165 /** 166 * Adds JavaScript to pages with the comment form to support 167 * sites with threaded comments (when in use). 168 */ 161 169 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) 162 170 wp_enqueue_script( 'comment-reply' ); … … 185 193 186 194 /** 195 * Filter the page title. 196 * 187 197 * Creates a nicely formatted and more specific title element text for output 188 198 * in head of document, based on current view. … … 191 201 * 192 202 * @param string $title Default title text for current view. 193 * @param string $sep Optional separator.203 * @param string $sep Optional separator. 194 204 * @return string The filtered title. 195 205 */ … … 217 227 218 228 /** 219 * Register stwo widget areas.229 * Register two widget areas. 220 230 * 221 231 * @since Twenty Thirteen 1.0 … … 248 258 if ( ! function_exists( 'twentythirteen_paging_nav' ) ) : 249 259 /** 250 * Display snavigation to next/previous set of posts when applicable.260 * Display navigation to next/previous set of posts when applicable. 251 261 * 252 262 * @since Twenty Thirteen 1.0 … … 281 291 if ( ! function_exists( 'twentythirteen_post_nav' ) ) : 282 292 /** 283 * Display snavigation to next/previous post when applicable.293 * Display navigation to next/previous post when applicable. 284 294 * 285 295 * @since Twenty Thirteen 1.0 … … 312 322 if ( ! function_exists( 'twentythirteen_entry_meta' ) ) : 313 323 /** 314 * Print sHTML with meta information for current post: categories, tags, permalink, author, and date.324 * Print HTML with meta information for current post: categories, tags, permalink, author, and date. 315 325 * 316 326 * Create your own twentythirteen_entry_meta() to override in a child theme. … … 352 362 if ( ! function_exists( 'twentythirteen_entry_date' ) ) : 353 363 /** 354 * Print sHTML with date information for current post.364 * Print HTML with date information for current post. 355 365 * 356 366 * Create your own twentythirteen_entry_date() to override in a child theme. … … 358 368 * @since Twenty Thirteen 1.0 359 369 * 360 * @param boolean $echo Whether to echo the date. Default true.370 * @param boolean $echo (optional) Whether to echo the date. Default true. 361 371 * @return string The HTML-formatted post date. 362 372 */ … … 383 393 if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) : 384 394 /** 385 * Print sthe attached image with a link to the next attached image.395 * Print the attached image with a link to the next attached image. 386 396 * 387 397 * @since Twenty Thirteen 1.0 … … 390 400 */ 391 401 function twentythirteen_the_attached_image() { 392 $post = get_post(); 402 /** 403 * Filter the image attachment size to use. 404 * 405 * @since Twenty thirteen 1.0 406 * 407 * @param array $size { 408 * @type int The attachment height in pixels. 409 * @type int The attachment width in pixels. 410 * } 411 */ 393 412 $attachment_size = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) ); 394 413 $next_attachment_url = wp_get_attachment_url(); 414 $post = get_post(); 395 415 396 416 /** … … 438 458 439 459 /** 440 * Return s the URL from the post.460 * Return the post URL. 441 461 * 442 462 * @uses get_url_in_content() to get the URL in the post meta (if it exists) or … … 457 477 458 478 /** 459 * Extend sthe default WordPress body classes.479 * Extend the default WordPress body classes. 460 480 * 461 481 * Adds body classes to denote: … … 484 504 485 505 /** 486 * Adjust scontent_width value for video post formats and attachment templates.506 * Adjust content_width value for video post formats and attachment templates. 487 507 * 488 508 * @since Twenty Thirteen 1.0 … … 516 536 517 537 /** 518 * Binds JavaScript handlers to make Customizer preview reload changes 519 * asynchronously. 520 * 521 * @since Twenty Thirteen 1.0 538 * Enqueue Javascript postMessage handlers for the Customizer. 539 * 540 * Binds JavaScript handlers to make the Customizer preview 541 * reload changes asynchronously. 542 * 543 * @since Twenty Thirteen 1.0 544 * 545 * @return void 522 546 */ 523 547 function twentythirteen_customize_preview_js() {
Note: See TracChangeset
for help on using the changeset viewer.