Ticket #7659: 7659.r8786.diff
File 7659.r8786.diff, 9.3 KB (added by , 16 years ago) |
---|
-
post-template.php
1 1 <?php 2 /** 3 * WordPress Post Template Functions 4 * 5 * Gets content for the current post in the loop. 6 * 7 * @package WordPress 8 * @subpackage Template 9 */ 2 10 3 // 4 // "The Loop" post functions 5 // 6 11 /** 12 * the_ID() - {@internal Missing Short Description}} 13 * 14 * {@internal Missing Long Description}} 15 * 16 * @since 0.71 17 * @uses $id 18 */ 7 19 function the_ID() { 8 20 global $id; 9 21 echo $id; 10 22 } 11 23 12 24 /** 25 * get_the_ID() - {@internal Missing Short Description}} 26 * 27 * {@internal Missing Long Description}} 28 * 29 * @since 2.1.0 30 * @uses $id 31 * 32 * @return unknown 33 */ 13 34 function get_the_ID() { 14 35 global $id; 15 36 return $id; 16 37 } 17 38 18 39 /** 40 * the_title() - {@internal Missing Short Description}} 41 * 42 * {@internal Missing Long Description}} 43 * 44 * @since 0.71 45 * 46 * @param unknown_type $before 47 * @param unknown_type $after 48 * @param unknown_type $echo 49 * @return unknown 50 */ 19 51 function the_title($before = '', $after = '', $echo = true) { 20 52 $title = get_the_title(); 21 53 … … 30 62 return $title; 31 63 } 32 64 65 /** 66 * the_title_attribute() - {@internal Missing Short Description}} 67 * 68 * {@internal Missing Long Description}} 69 * 70 * @since 2.3.0 71 * 72 * @param unknown_type $args 73 * @return unknown 74 */ 33 75 function the_title_attribute( $args = '' ) { 34 76 $title = get_the_title(); 35 77 … … 50 92 return $title; 51 93 } 52 94 95 /** 96 * get_the_title() - {@internal Missing Short Description}} 97 * 98 * {@internal Missing Long Description}} 99 * 100 * @since 0.71 101 * 102 * @param unknown_type $id 103 * @return unknown 104 */ 53 105 function get_the_title( $id = 0 ) { 54 106 $post = &get_post($id); 55 107 … … 64 116 return apply_filters( 'the_title', $title ); 65 117 } 66 118 119 /** 120 * the_guid() - {@internal Missing Short Description}} 121 * 122 * {@internal Missing Long Description}} 123 * 124 * @since 1.5.0 125 * 126 * @param unknown_type $id 127 */ 67 128 function the_guid( $id = 0 ) { 68 129 echo get_the_guid($id); 69 130 } 70 131 132 /** 133 * get_the_guid() - {@internal Missing Short Description}} 134 * 135 * {@internal Missing Long Description}} 136 * 137 * @since 1.5.0 138 * 139 * @param unknown_type $id 140 * @return unknown 141 */ 71 142 function get_the_guid( $id = 0 ) { 72 143 $post = &get_post($id); 73 144 74 145 return apply_filters('get_the_guid', $post->guid); 75 146 } 76 147 148 /** 149 * the_content() - {@internal Missing Short Description}} 150 * 151 * {@internal Missing Long Description}} 152 * 153 * @since 0.71 154 * 155 * @param unknown_type $more_link_text 156 * @param unknown_type $stripteaser 157 * @param unknown_type $more_file 158 */ 77 159 function the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') { 78 160 $content = get_the_content($more_link_text, $stripteaser, $more_file); 79 161 $content = apply_filters('the_content', $content); … … 81 163 echo $content; 82 164 } 83 165 84 166 /** 167 * get_the_content() - {@internal Missing Short Description}} 168 * 169 * {@internal Missing Long Description}} 170 * 171 * @since 0.71 172 * 173 * @param unknown_type $more_link_text 174 * @param unknown_type $stripteaser 175 * @param unknown_type $more_file 176 * @return unknown 177 */ 85 178 function get_the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') { 86 179 global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; 87 180 … … 135 228 return $output; 136 229 } 137 230 138 231 /** 232 * the_excerpt() - {@internal Missing Short Description}} 233 * 234 * {@internal Missing Long Description}} 235 * 236 * @since 0.71 237 * @uses apply_filters() - 238 */ 139 239 function the_excerpt() { 140 240 echo apply_filters('the_excerpt', get_the_excerpt()); 141 241 } 142 242 143 243 /** 244 * get_the_excerpt() - {@internal Missing Short Description}} 245 * 246 * {@internal Missing Long Description}} 247 * 248 * @since 0.71 249 * 250 * @param unknown_type $deprecated 251 * @return unknown 252 */ 144 253 function get_the_excerpt($deprecated = '') { 145 254 global $post; 146 255 $output = ''; … … 155 264 return apply_filters('get_the_excerpt', $output); 156 265 } 157 266 267 /** 268 * has_excerpt() - {@internal Missing Short Description}} 269 * 270 * {@internal Missing Long Description}} 271 * 272 * @since 2.3.0 273 * 274 * @param unknown_type $id 275 * @return unknown 276 */ 158 277 function has_excerpt( $id = 0 ) { 159 278 $post = &get_post( $id ); 160 279 return ( !empty( $post->post_excerpt ) ); … … 245 364 echo " sticky"; 246 365 } 247 366 367 /** 368 * wp_link_pages() - {@internal Missing Short Description}} 369 * 370 * {@internal Missing Long Description}} 371 * 372 * @since 1.2.0 373 * 374 * @param unknown_type $args 375 * @return unknown 376 */ 248 377 function wp_link_pages($args = '') { 249 378 $defaults = array( 250 379 'before' => '<p>' . __('Pages:'), 'after' => '</p>', … … 325 454 // Post-meta: Custom per-post fields. 326 455 // 327 456 328 457 /** 458 * post_custom() - {@internal Missing Short Description}} 459 * 460 * {@internal Missing Long Description}} 461 * 462 * @since 1.5.0 463 * 464 * @param unknown_type $key 465 * @return unknown 466 */ 329 467 function post_custom( $key = '' ) { 330 468 $custom = get_post_custom(); 331 469 … … 337 475 338 476 339 477 // this will probably change at some point... 478 /** 479 * the_meta() - {@internal Missing Short Description}} 480 * 481 * {@internal Missing Long Description}} 482 * 483 * @since 1.2.0 484 * @uses apply_filters() 485 */ 340 486 function the_meta() { 341 487 if ( $keys = get_post_custom_keys() ) { 342 488 echo "<ul class='post-meta'>\n"; … … 357 503 // Pages 358 504 // 359 505 506 /** 507 * wp_dropdown_pages() - {@internal Missing Short Description}} 508 * 509 * {@internal Missing Long Description}} 510 * 511 * @since 2.1.0 512 * 513 * @param unknown_type $args 514 * @return unknown 515 */ 360 516 function wp_dropdown_pages($args = '') { 361 517 $defaults = array( 362 518 'depth' => 0, 'child_of' => 0, … … 386 542 return $output; 387 543 } 388 544 545 /** 546 * wp_list_pages() - {@internal Missing Short Description}} 547 * 548 * {@internal Missing Long Description}} 549 * 550 * @since 1.5.0 551 * 552 * @param unknown_type $args 553 * @return unknown 554 */ 389 555 function wp_list_pages($args = '') { 390 556 $defaults = array( 391 557 'depth' => 0, 'show_date' => '', … … 436 602 // Page helpers 437 603 // 438 604 605 /** 606 * walk_page_tree() - {@internal Missing Short Description}} 607 * 608 * {@internal Missing Long Description}} 609 * 610 * @since 2.1.0 611 * 612 * @return unknown 613 */ 439 614 function walk_page_tree() { 440 615 $walker = new Walker_Page; 441 616 $args = func_get_args(); 442 617 return call_user_func_array(array(&$walker, 'walk'), $args); 443 618 } 444 619 620 /** 621 * walk_page_dropdown_tree() - {@internal Missing Short Description}} 622 * 623 * {@internal Missing Long Description}} 624 * 625 * @since 2.1.0 626 * 627 * @return unknown 628 */ 445 629 function walk_page_dropdown_tree() { 446 630 $walker = new Walker_PageDropdown; 447 631 $args = func_get_args(); … … 452 636 // Attachments 453 637 // 454 638 639 /** 640 * the_attachment_link() - {@internal Missing Short Description}} 641 * 642 * {@internal Missing Long Description}} 643 * 644 * @since 2.0.0 645 * 646 * @param unknown_type $id 647 * @param unknown_type $fullsize 648 * @param unknown_type $max_dims 649 */ 455 650 function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) { 456 651 if ( $fullsize ) 457 652 echo wp_get_attachment_link($id, 'full', $permalink); … … 499 694 500 695 501 696 // deprecated: use wp_get_attachment_image_src() 697 /** 698 * get_attachment_icon_src() - {@internal Missing Short Description}} 699 * 700 * {@internal Missing Long Description}} 701 * 702 * @since 2.1.0 703 * 704 * @param unknown_type $id 705 * @param unknown_type $fullsize 706 * @return unknown 707 */ 502 708 function get_attachment_icon_src( $id = 0, $fullsize = false ) { 503 709 $id = (int) $id; 504 710 if ( !$post = & get_post($id) ) … … 531 737 } 532 738 533 739 // deprecated: use wp_get_attachment_image() 740 /** 741 * get_attachment_icon() - {@internal Missing Short Description}} 742 * 743 * {@internal Missing Long Description}} 744 * 745 * @since 2.0.0 746 * 747 * @param unknown_type $id 748 * @param unknown_type $fullsize 749 * @param unknown_type $max_dims 750 * @return unknown 751 */ 534 752 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { 535 753 $id = (int) $id; 536 754 if ( !$post = & get_post($id) ) … … 575 793 } 576 794 577 795 // deprecated: use wp_get_attachment_image() 796 /** 797 * get_attachment_innerHTML() - {@internal Missing Short Description}} 798 * 799 * {@internal Missing Long Description}} 800 * 801 * @since 2.0.0 802 * 803 * @param unknown_type $id 804 * @param unknown_type $fullsize 805 * @param unknown_type $max_dims 806 * @return unknown 807 */ 578 808 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 579 809 $id = (int) $id; 580 810 if ( !$post = & get_post($id) ) … … 589 819 return apply_filters('attachment_innerHTML', $innerHTML, $post->ID); 590 820 } 591 821 822 /** 823 * prepend_attachment() - {@internal Missing Short Description}} 824 * 825 * {@internal Missing Long Description}} 826 * 827 * @since 2.0.0 828 * 829 * @param unknown_type $content 830 * @return unknown 831 */ 592 832 function prepend_attachment($content) { 593 833 global $post; 594 834 … … 608 848 // Misc 609 849 // 610 850 851 /** 852 * get_the_password_form() - {@internal Missing Short Description}} 853 * 854 * {@internal Missing Long Description}} 855 * 856 * @since 1.0.0 857 * 858 * @return unknown 859 */ 611 860 function get_the_password_form() { 612 861 global $post; 613 862 $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID); … … 626 875 * You can optional provide a template name and then the check will be specific to 627 876 * that template. 628 877 * 629 * @package Template Tags 630 * @global object $wp_query 878 * @since 2.5.0 879 * @uses $wp_query 880 * 631 881 * @param string $template The specific template name if specific matching is required 882 * @return bool False on failure, true if success 632 883 */ 633 884 function is_page_template($template = '') { 634 885 if (!is_page()) {