Ticket #7659: 7659.r9239.diff
File 7659.r9239.diff, 15.3 KB (added by , 16 years ago) |
---|
-
post-template.php
92 92 } 93 93 94 94 /** 95 * {@internal Missing Short Description}}95 * Retrieve post title. 96 96 * 97 * {@internal Missing Long Description}} 97 * If the post is protected and the visitor is not an admin, then "Protected" 98 * will be displayed before the post title. If the post is private, then 99 * "Private" will be located before the post title. 98 100 * 99 101 * @since 0.71 100 102 * 101 * @param int $id 102 * @return unknown103 * @param int $id Optional. Post ID. 104 * @return string 103 105 */ 104 106 function get_the_title( $id = 0 ) { 105 107 $post = &get_post($id); … … 116 118 } 117 119 118 120 /** 119 * {@internal Missing Short Description}}121 * Display the Post Global Unique Identifier (guid). 120 122 * 121 * {@internal Missing Long Description}} 123 * The guid will appear to be a link, but should not be used as an link to the 124 * post. The reason you should not use it as a link, is because of moving the 125 * blog across domains. 122 126 * 123 127 * @since 1.5.0 124 128 * 125 * @param unknown_type $id129 * @param int $id Optional. Post ID. 126 130 */ 127 131 function the_guid( $id = 0 ) { 128 132 echo get_the_guid($id); 129 133 } 130 134 131 135 /** 132 * {@internal Missing Short Description}}136 * Retrieve the Post Global Unique Identifier (guid). 133 137 * 134 * {@internal Missing Long Description}} 138 * The guid will appear to be a link, but should not be used as an link to the 139 * post. The reason you should not use it as a link, is because of moving the 140 * blog across domains. 135 141 * 136 142 * @since 1.5.0 137 143 * 138 * @param unknown_type $id139 * @return unknown144 * @param int $id Optional. Post ID. 145 * @return string 140 146 */ 141 147 function get_the_guid( $id = 0 ) { 142 148 $post = &get_post($id); … … 145 151 } 146 152 147 153 /** 148 * {@internal Missing Short Description}}154 * Display the post content. 149 155 * 150 * {@internal Missing Long Description}}151 *152 156 * @since 0.71 153 157 * 154 * @param unknown_type $more_link_text155 * @param unknown_type $stripteaser156 * @param unknown_type $more_file158 * @param string $more_link_text Optional. Content for when there is more text. 159 * @param string $stripteaser Optional. Teaser content before the more text. 160 * @param string $more_file Optional. Not used. 157 161 */ 158 162 function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { 159 163 $content = get_the_content($more_link_text, $stripteaser, $more_file); … … 163 167 } 164 168 165 169 /** 166 * {@internal Missing Short Description}}170 * Retrieve the post content. 167 171 * 168 * {@internal Missing Long Description}}169 *170 172 * @since 0.71 171 173 * 172 * @param unknown_type $more_link_text173 * @param unknown_type $stripteaser174 * @param unknown_type $more_file175 * @return unknown174 * @param string $more_link_text Optional. Content for when there is more text. 175 * @param string $stripteaser Optional. Teaser content before the more text. 176 * @param string $more_file Optional. Not used. 177 * @return string 176 178 */ 177 179 function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { 178 180 global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; … … 182 184 183 185 $output = ''; 184 186 185 if ( post_password_required($post) ) { // If post password required and it doesn't match the cookie 187 // If post password required and it doesn't match the cookie. 188 if ( post_password_required($post) ) { 186 189 $output = get_the_password_form(); 187 190 return $output; 188 191 } … … 226 229 } 227 230 228 231 /** 229 * {@internal Missing Short Description}}232 * Display the post excerpt. 230 233 * 231 * {@internal Missing Long Description}}232 *233 234 * @since 0.71 234 * @uses apply_filters() -235 * @uses apply_filters() Calls 'the_excerpt' hook on post excerpt. 235 236 */ 236 237 function the_excerpt() { 237 238 echo apply_filters('the_excerpt', get_the_excerpt()); 238 239 } 239 240 240 241 /** 241 * {@internal Missing Short Description}}242 * Retrieve the post excerpt. 242 243 * 243 * {@internal Missing Long Description}}244 *245 244 * @since 0.71 246 245 * 247 * @param unknown_type $deprecated248 * @return unknown246 * @param mixed $deprecated Not used. 247 * @return string 249 248 */ 250 249 function get_the_excerpt($deprecated = '') { 251 250 global $post; … … 260 259 } 261 260 262 261 /** 263 * {@internal Missing Short Description}}262 * Whether post has excerpt. 264 263 * 265 * {@internal Missing Long Description}}266 *267 264 * @since 2.3.0 268 265 * 269 * @param unknown_type $id270 * @return unknown266 * @param int $id Optional. Post ID. 267 * @return bool 271 268 */ 272 269 function has_excerpt( $id = 0 ) { 273 270 $post = &get_post( $id ); … … 277 274 /** 278 275 * Display the classes for the post div. 279 276 * 280 * {@internal Missing Long Description}}281 *282 277 * @since 2.7.0 283 278 * 284 * @param string|array $class One or more classes to add to the class list 279 * @param string|array $class One or more classes to add to the class list. 285 280 * @param int $post_id An optional post ID. 286 281 */ 287 282 function post_class( $class = '', $post_id = null ) { … … 292 287 /** 293 288 * Retrieve the classes for the post div as an array. 294 289 * 295 * {@internal Missing Long Description}} 290 * The class names are add are many. If the post is a sticky, then the 'sticky' 291 * class name. The class 'hentry' is always added to each post. For each 292 * category, the class will be added with 'category-' with category slug is 293 * added. The tags are the same way as the categories with 'tag-' before the tag 294 * slug. All classes are passed through the filter, 'post_class' with the list 295 * of classes, followed by $class parameter value, with the post ID as the last 296 * parameter. 296 297 * 297 298 * @since 2.7.0 298 299 * 299 * @param string|array $class One or more classes to add to the class list 300 * @param int $post_id An optional post ID 301 * @return array Array of classes 300 * @param string|array $class One or more classes to add to the class list. 301 * @param int $post_id An optional post ID. 302 * @return array Array of classes. 302 303 */ 303 304 function get_post_class( $class = '', $post_id = null ) { 304 305 $post = get_post($post_id); … … 338 339 } 339 340 340 341 /** 341 * Determines if post requires a password and if thecorrect password has been provided.342 * Whether post requires password and correct password has been provided. 342 343 * 343 * {@internal Missing Long Description}}344 *345 344 * @since 2.7.0 346 345 * 347 346 * @param int|object $post An optional post. Global $post used if not provided. 348 * @return bool false if a password is not required or the correct password cookie is present, true otherwise 347 * @return bool false if a password is not required or the correct password cookie is present, true otherwise. 349 348 */ 350 349 function post_password_required( $post = null ) { 351 350 $post = get_post($post); … … 367 366 * 368 367 * @since 2.7.0 369 368 * 370 * @param int $post_id An optional post ID 369 * @param int $post_id An optional post ID. 371 370 */ 372 371 function sticky_class( $post_id = null ) { 373 372 if ( !is_sticky($post_id) ) … … 384 383 */ 385 384 386 385 /** 387 * The formatted output of a list of Pages.386 * The formatted output of a list of pages. 388 387 * 389 * Displays page-links for paginated posts (i.e. includes the <!--nextpage--> Quicktag one or 390 * more times). This works in much the same way as link_pages(), the difference being that 391 * arguments are given in query string format. This tag must be within The_Loop. 388 * Displays page links for paginated posts (i.e. includes the <!--nextpage-->. 389 * Quicktag one or more times). This works in much the same way as link_pages(), 390 * the difference being that arguments are given in query string format. This 391 * tag must be within The Loop. 392 392 * 393 393 * The defaults for overwriting are: 394 * 'next_or_number' - Default is 'number' (string). Indicates whether page numbers should be395 * used. Valid values are number and next.394 * 'next_or_number' - Default is 'number' (string). Indicates whether page 395 * numbers should be used. Valid values are number and next. 396 396 * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page. 397 * 398 * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to previous page.399 * 400 * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in the401 * parameter string will be replaced with the page number, so Page % generates402 * "Page 1", "Page 2", etc. Defaults to %, just the page number.403 * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to each404 * 397 * of the bookmark. 398 * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to 399 * previous page, if available. 400 * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in 401 * the parameter string will be replaced with the page number, so Page % 402 * generates "Page 1", "Page 2", etc. Defaults to %, just the page number. 403 * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to 404 * each bookmarks. 405 405 * 'after' - Default is '</p>' (string). The html or text to append to each 406 * 407 * 'more_file' - Default is '' (string) Page the links should point to. Defaults to408 * t he current page.406 * bookmarks. 407 * 'more_file' - Default is '' (string) Page the links should point to. Defaults 408 * to the current page. 409 409 * 'link_before' - Default is '' (string). The html or text to prepend to each 410 * 410 * Pages link inside the <a> tag. 411 411 * 'link_after' - Default is '' (string). The html or text to append to each 412 * 412 * Pages link inside the <a> tag. 413 413 * 414 414 * @since 1.2.0 415 415 * @access private 416 416 * 417 * @param array $bookmarks List of bookmarks to traverse418 417 * @param string|array $args Optional. Overwrite the defaults. 419 * @return string Formatted output in HTML 418 * @return string Formatted output in HTML. 420 419 */ 421 420 function wp_link_pages($args = '') { 422 421 $defaults = array( … … 541 540 } 542 541 } 543 542 544 545 543 // 546 544 // Pages 547 545 // 548 546 549 547 /** 550 * {@internal Missing Short Description}}548 * Retrieve or display list of pages as a dropdown (select list). 551 549 * 552 * {@internal Missing Long Description}}553 *554 550 * @since 2.1.0 555 551 * 556 * @param unknown_type $args557 * @return unknown552 * @param array|string $args Optional. Override default arguments. 553 * @return string HTML content, if not displaying. 558 554 */ 559 555 function wp_dropdown_pages($args = '') { 560 556 $defaults = array( … … 586 582 } 587 583 588 584 /** 589 * {@internal Missing Short Description}}585 * Retrieve or display list of pages in list (li) format. 590 586 * 591 * {@internal Missing Long Description}}592 *593 587 * @since 1.5.0 594 588 * 595 589 * @param array|string $args Optional. Override default arguments. 596 * @return unknown590 * @return string HTML content, if not displaying. 597 591 */ 598 592 function wp_list_pages($args = '') { 599 593 $defaults = array( … … 711 705 // 712 706 713 707 /** 714 * {@internal Missing Short Description}}708 * Display an attachment page link using an image or icon. 715 709 * 716 * {@internal Missing Long Description}}717 *718 710 * @since 2.0.0 719 711 * 720 * @param unknown_type $id 721 * @param unknown_type $fullsize 722 * @param unknown_type $max_dims 712 * @param int $id Optional. Post ID. 713 * @param bool $fullsize Optional, default is false. Whether to use full size. 714 * @param bool $deprecated Deprecated. Not used. 715 * @param bool $permalink Optional, default is false. Whether to include permalink. 723 716 */ 724 717 function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) { 725 718 if ( $fullsize ) … … 731 724 /** 732 725 * Retrieve an attachment page link using an image or icon, if possible. 733 726 * 734 * {@internal Missing Long Description}} 727 * @since 2.5.0 728 * @uses apply_filters() Calls 'wp_get_attachment_link' filter on HTML content with same parameters as function. 735 729 * 736 * @since unknown 737 * 738 * @param unknown_type $id 739 * @param unknown_type $size 740 * @param unknown_type $permalink 741 * @param unknown_type $icon 742 * @return unknown 730 * @param int $id Optional. Post ID. 731 * @param string $size Optional. Image size. 732 * @param bool $permalink Optional, default is false. Whether to add permalink to image. 733 * @param bool $icon Optional, default is false. Whether to include icon. 734 * @return string HTML content. 743 735 */ 744 736 function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) { 745 737 $id = intval($id); … … 761 753 } 762 754 763 755 /** 764 * {@internal Missing Short Description}}756 * Retrieve HTML content of attachment image with link. 765 757 * 766 * {@internal Missing Long Description}} 767 * 768 * @since unknown 758 * @since 2.0.0 769 759 * @deprecated Use {@link wp_get_attachment_link()} 770 760 * @see wp_get_attachment_link() Use instead. 771 761 * 772 * @param unknown_type $id773 * @param unknown_type $fullsize774 * @param unknown_type $max_dims775 * @param unknown_type $permalink776 * @return unknown762 * @param int $id Optional. Post ID. 763 * @param bool $fullsize Optional, default is false. Whether to use full size image. 764 * @param array $max_dims Optional. Max image dimensions. 765 * @param bool $permalink Optional, default is false. Whether to include permalink to image. 766 * @return string 777 767 */ 778 768 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 779 769 $id = (int) $id; … … 792 782 } 793 783 794 784 /** 795 * {@internal Missing Short Description}}785 * Retrieve icon URL and Path. 796 786 * 797 * {@internal Missing Long Description}}798 *799 787 * @since 2.1.0 800 788 * @deprecated Use {@link wp_get_attachment_image_src()} 801 789 * @see wp_get_attachment_image_src() Use instead. 802 790 * 803 * @param unknown_type $id804 * @param unknown_type $fullsize805 * @return unknown791 * @param int $id Optional. Post ID. 792 * @param bool $fullsize Optional, default to false. Whether to have full image. 793 * @return array Icon URL and full path to file, respectively. 806 794 */ 807 795 function get_attachment_icon_src( $id = 0, $fullsize = false ) { 808 796 $id = (int) $id; … … 836 824 } 837 825 838 826 /** 839 * {@internal Missing Short Description}}827 * Retrieve HTML content of icon attachment image element. 840 828 * 841 * {@internal Missing Long Description}}842 *843 829 * @since 2.0.0 844 830 * @deprecated Use {@link wp_get_attachment_image()} 845 831 * @see wp_get_attachment_image() Use instead of. 846 832 * 847 * @param unknown_type $id848 * @param unknown_type $fullsize849 * @param unknown_type $max_dims850 * @return unknown833 * @param int $id Optional. Post ID. 834 * @param bool $fullsize Optional, default to false. Whether to have full size image. 835 * @param array $max_dims Optional. Dimensions of image. 836 * @return string HTML content. 851 837 */ 852 838 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { 853 839 $id = (int) $id; … … 893 879 } 894 880 895 881 /** 896 * {@internal Missing Short Description}}882 * Retrieve HTML content of image element. 897 883 * 898 * {@internal Missing Long Description}}899 *900 884 * @since 2.0.0 901 885 * @deprecated Use {@link wp_get_attachment_image()} 902 886 * @see wp_get_attachment_image() Use instead. 903 887 * 904 * @param unknown_type $id905 * @param unknown_type $fullsize906 * @param unknown_type $max_dims907 * @return unknown888 * @param int $id Optional. Post ID. 889 * @param bool $fullsize Optional, default to false. Whether to have full size image. 890 * @param array $max_dims Optional. Dimensions of image. 891 * @return string 908 892 */ 909 893 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 910 894 $id = (int) $id; … … 921 905 } 922 906 923 907 /** 924 * {@internal Missing Short Description}}908 * Wrap attachment in <<p>> element before content. 925 909 * 926 * {@internal Missing Long Description}}927 *928 910 * @since 2.0.0 911 * @uses apply_filters() Calls 'prepend_attachment' hook on HTML content. 929 912 * 930 * @param unknown_type$content931 * @return unknown913 * @param string $content 914 * @return string 932 915 */ 933 916 function prepend_attachment($content) { 934 917 global $post;