Changeset 25627 for trunk/src/wp-content/themes/twentyten/functions.php
- Timestamp:
- 09/25/2013 05:03:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyten/functions.php
r24195 r25627 53 53 if ( ! function_exists( 'twentyten_setup' ) ): 54 54 /** 55 * Set sup theme defaults and registers support for various WordPress features.55 * Set up theme defaults and registers support for various WordPress features. 56 56 * 57 57 * Note that this function is hooked into the after_setup_theme hook, which runs … … 62 62 * functions.php file. 63 63 * 64 * @uses add_theme_support() To add support for post thumbnails, custom headers and backgrounds, and automatic feed links.65 * @uses register_nav_menus() To add support for navigation menus.66 * @uses add_editor_style() To style the visual editor.67 * @uses load_theme_textdomain() For translation/localization support.64 * @uses add_theme_support() To add support for post thumbnails, custom headers and backgrounds, and automatic feed links. 65 * @uses register_nav_menus() To add support for navigation menus. 66 * @uses add_editor_style() To style the visual editor. 67 * @uses load_theme_textdomain() For translation/localization support. 68 68 * @uses register_default_headers() To register the default custom header images provided with the theme. 69 * @uses set_post_thumbnail_size() To set a custom post thumbnail size.69 * @uses set_post_thumbnail_size() To set a custom post thumbnail size. 70 70 * 71 71 * @since Twenty Ten 1.0 … … 85 85 add_theme_support( 'automatic-feed-links' ); 86 86 87 // Make theme available for translation 88 // Translations can be filed in the /languages/ directory 87 /** 88 * Make theme available for translation. 89 * Translations can be filed in the /languages/ directory 90 */ 89 91 load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' ); 90 92 … … 103 105 104 106 $custom_header_support = array( 105 // The default image to use. 106 // The %s is a placeholder for the theme template directory URI. 107 /** 108 * The default image to use. 109 * The %s is a placeholder for the theme template directory URI. 110 */ 107 111 'default-image' => '%s/images/headers/path.jpg', 108 112 // The height and width of our custom header. 113 /** 114 * Filter the Twenty Ten default header image width. 115 * 116 * @since Twenty Ten 1.0 117 * 118 * @param int The default header image width in pixels. Default 940. 119 */ 109 120 'width' => apply_filters( 'twentyten_header_image_width', 940 ), 121 /** 122 * Filter the Twenty Ten defaul header image height. 123 * 124 * @since Twenty Ten 1.0 125 * 126 * @param int The default header image height in pixels. Default 198. 127 */ 110 128 'height' => apply_filters( 'twentyten_header_image_height', 198 ), 111 129 // Support flexible heights. … … 130 148 } 131 149 132 // We'll be using post thumbnails for custom header images on posts and pages. 133 // We want them to be 940 pixels wide by 198 pixels tall. 134 // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 150 /** 151 * We'll be using post thumbnails for custom header images on posts and pages. 152 * We want them to be 940 pixels wide by 198 pixels tall. 153 * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 154 */ 135 155 set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); 136 156 … … 193 213 if ( ! function_exists( 'twentyten_admin_header_style' ) ) : 194 214 /** 195 * Style sthe header image displayed on the Appearance > Header admin panel.215 * Style the header image displayed on the Appearance > Header admin panel. 196 216 * 197 217 * Referenced via add_custom_image_header() in twentyten_setup(). … … 217 237 218 238 /** 219 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.239 * Show a home link for our wp_nav_menu() fallback, wp_page_menu(). 220 240 * 221 241 * To override this in a child theme, remove the filter and optionally add … … 223 243 * 224 244 * @since Twenty Ten 1.0 245 * 246 * @param array $args An optional array of arguments. @see wp_page_menu() 225 247 */ 226 248 function twentyten_page_menu_args( $args ) { … … 232 254 233 255 /** 234 * Set sthe post excerpt length to 40 characters.256 * Set the post excerpt length to 40 characters. 235 257 * 236 258 * To override this length in a child theme, remove the filter and add your own … … 238 260 * 239 261 * @since Twenty Ten 1.0 240 * @return int 262 * 263 * @param int $length The number of excerpt characters. 264 * @return int The filtered number of excerpt characters. 241 265 */ 242 266 function twentyten_excerpt_length( $length ) { … … 247 271 if ( ! function_exists( 'twentyten_continue_reading_link' ) ) : 248 272 /** 249 * Returns a "Continue Reading" link for excerpts 250 * 251 * @since Twenty Ten 1.0 252 * @return string "Continue Reading" link 273 * Return a "Continue Reading" link for excerpts. 274 * 275 * @since Twenty Ten 1.0 276 * 277 * @return string "Continue Reading" link. 253 278 */ 254 279 function twentyten_continue_reading_link() { … … 258 283 259 284 /** 260 * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link(). 285 * Replace "[...]" with an ellipsis and twentyten_continue_reading_link(). 286 * 287 * "[...]" is appended to automatically generated excerpts. 261 288 * 262 289 * To override this in a child theme, remove the filter and add your own … … 264 291 * 265 292 * @since Twenty Ten 1.0 266 * @return string An ellipsis 293 * 294 * @param string $more The Read More text. 295 * @return string An ellipsis. 267 296 */ 268 297 function twentyten_auto_excerpt_more( $more ) { … … 272 301 273 302 /** 274 * Add sa pretty "Continue Reading" link to custom post excerpts.303 * Add a pretty "Continue Reading" link to custom post excerpts. 275 304 * 276 305 * To override this link in a child theme, remove the filter and add your own … … 278 307 * 279 308 * @since Twenty Ten 1.0 280 * @return string Excerpt with a pretty "Continue Reading" link 309 * 310 * @param string $output The "Coninue Reading" link. 311 * @return string Excerpt with a pretty "Continue Reading" link. 281 312 */ 282 313 function twentyten_custom_excerpt_more( $output ) { … … 326 357 * 327 358 * @since Twenty Ten 1.0 359 * 360 * @param object $comment The comment object. 361 * @param array $args An array of arguments. @see get_comment_reply_link() 362 * @param int $depth The depth of the comment. 328 363 */ 329 364 function twentyten_comment( $comment, $args, $depth ) { … … 377 412 * 378 413 * @since Twenty Ten 1.0 379 * @uses register_sidebar 414 * 415 * @uses register_sidebar() 380 416 */ 381 417 function twentyten_widgets_init() { … … 450 486 451 487 /** 452 * Remove sthe default styles that are packaged with the Recent Comments widget.488 * Remove the default styles that are packaged with the Recent Comments widget. 453 489 * 454 490 * To override this in a child theme, remove the filter and optionally add your own … … 468 504 if ( ! function_exists( 'twentyten_posted_on' ) ) : 469 505 /** 470 * Print sHTML with meta information for the current post-date/time and author.506 * Print HTML with meta information for the current post-date/time and author. 471 507 * 472 508 * @since Twenty Ten 1.0 … … 491 527 if ( ! function_exists( 'twentyten_posted_in' ) ) : 492 528 /** 493 * Print sHTML with meta information for the current post (category, tags and permalink).529 * Print HTML with meta information for the current post (category, tags and permalink). 494 530 * 495 531 * @since Twenty Ten 1.0 … … 517 553 518 554 /** 519 * Retrieve sthe IDs for images in a gallery.520 * 521 * @uses get_post_galleries() first, if available. Falls back to shortcode parsing,522 * then as last option uses a get_posts() call.555 * Retrieve the IDs for images in a gallery. 556 * 557 * @uses get_post_galleries() First, if available. Falls back to shortcode parsing, 558 * then as last option uses a get_posts() call. 523 559 * 524 560 * @since Twenty Ten 1.6.
Note: See TracChangeset
for help on using the changeset viewer.