Changeset 9138
- Timestamp:
- 10/13/2008 10:28:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r8926 r9138 1 1 <?php 2 2 /** 3 * WordPress Post Template Functions 3 * WordPress Post Template Functions. 4 4 * 5 5 * Gets content for the current post in the loop. … … 10 10 11 11 /** 12 * the_ID() - {@internal Missing Short Description}} 13 * 14 * {@internal Missing Long Description}} 12 * Display the ID of the current item in the WordPress Loop. 15 13 * 16 14 * @since 0.71 … … 23 21 24 22 /** 25 * get_the_ID() - {@internal Missing Short Description}} 26 * 27 * {@internal Missing Long Description}} 23 * Retrieve the ID of the current item in the WordPress Loop. 28 24 * 29 25 * @since 2.1.0 … … 38 34 39 35 /** 40 * the_title() - {@internal Missing Short Description}} 41 * 42 * {@internal Missing Long Description}} 36 * Display or retrieve the current post title with optional content. 43 37 * 44 38 * @since 0.71 45 39 * 46 * @param unknown_type $before47 * @param unknown_type $after48 * @param unknown_type $echo49 * @return unknown40 * @param string $before Optional. Content to prepend to the title. 41 * @param string $after Optional. Content to append to the title. 42 * @param bool $echo Optional, default to true.Whether to display or return. 43 * @return null|string Null on no title. String if $echo parameter is false. 50 44 */ 51 45 function the_title($before = '', $after = '', $echo = true) { … … 64 58 65 59 /** 66 * the_title_attribute() - {@internal Missing Short Description}} 67 * 68 * {@internal Missing Long Description}} 60 * Sanitize the current title when retrieving or displaying. 61 * 62 * Works like {@link the_title()}, except the parameters can be in a string or 63 * an array. See the function for what can be override in the $args parameter. 64 * 65 * The title before it is displayed will have the tags stripped and {@link 66 * attribute_escape()} before it is passed to the user or displayed. The default 67 * as with {@link the_title()}, is to display the title. 69 68 * 70 69 * @since 2.3.0 71 70 * 72 * @param unknown_type $args73 * @return unknown71 * @param string|array $args Optional. Override the defaults. 72 * @return string|null Null on failure or display. String when echo is false. 74 73 */ 75 74 function the_title_attribute( $args = '' ) { … … 94 93 95 94 /** 96 * get_the_title() -{@internal Missing Short Description}}95 * {@internal Missing Short Description}} 97 96 * 98 97 * {@internal Missing Long Description}} … … 100 99 * @since 0.71 101 100 * 102 * @param unknown_type$id101 * @param int $id 103 102 * @return unknown 104 103 */ … … 118 117 119 118 /** 120 * the_guid() -{@internal Missing Short Description}}119 * {@internal Missing Short Description}} 121 120 * 122 121 * {@internal Missing Long Description}} … … 131 130 132 131 /** 133 * get_the_guid() -{@internal Missing Short Description}}132 * {@internal Missing Short Description}} 134 133 * 135 134 * {@internal Missing Long Description}} … … 147 146 148 147 /** 149 * the_content() -{@internal Missing Short Description}}148 * {@internal Missing Short Description}} 150 149 * 151 150 * {@internal Missing Long Description}} … … 157 156 * @param unknown_type $more_file 158 157 */ 159 function the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') {158 function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { 160 159 $content = get_the_content($more_link_text, $stripteaser, $more_file); 161 160 $content = apply_filters('the_content', $content); … … 165 164 166 165 /** 167 * get_the_content() -{@internal Missing Short Description}}166 * {@internal Missing Short Description}} 168 167 * 169 168 * {@internal Missing Long Description}} … … 176 175 * @return unknown 177 176 */ 178 function get_the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') {177 function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { 179 178 global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; 180 179 181 if ( NULL== $more_link_text )180 if ( null == $more_link_text ) 182 181 $more_link_text = __( '(more...)' ); 183 182 … … 228 227 229 228 /** 230 * the_excerpt() -{@internal Missing Short Description}}229 * {@internal Missing Short Description}} 231 230 * 232 231 * {@internal Missing Long Description}} … … 240 239 241 240 /** 242 * get_the_excerpt() -{@internal Missing Short Description}}241 * {@internal Missing Short Description}} 243 242 * 244 243 * {@internal Missing Long Description}} … … 262 261 263 262 /** 264 * has_excerpt() -{@internal Missing Short Description}}263 * {@internal Missing Short Description}} 265 264 * 266 265 * {@internal Missing Long Description}} … … 277 276 278 277 /** 279 * Echo the classes for the post div 280 * 281 * {@internal Missing Long Description}} 282 * 283 * @package WordPress 284 * @subpackage Post 285 * @since 2.7 278 * Display the classes for the post div. 279 * 280 * {@internal Missing Long Description}} 281 * 282 * @since 2.7.0 286 283 * 287 284 * @param string|array $class One or more classes to add to the class list 288 * @param int $post_id An optional post ID 285 * @param int $post_id An optional post ID. 289 286 */ 290 287 function post_class( $class = '', $post_id = null ) { … … 294 291 295 292 /** 296 * Returns the classes for the post div as an array 297 * 298 * {@internal Missing Long Description}} 299 * 300 * @package WordPress 301 * @subpackage Post 302 * @since 2.7 293 * Retrieve the classes for the post div as an array. 294 * 295 * {@internal Missing Long Description}} 296 * 297 * @since 2.7.0 303 298 * 304 299 * @param string|array $class One or more classes to add to the class list … … 344 339 345 340 /** 346 * Determines if post requires a password and if the correct password has been provided 347 * 348 * {@internal Missing Long Description}} 349 * 350 * @package WordPress 351 * @subpackage Post 352 * @since 2.7 341 * Determines if post requires a password and if the correct password has been provided. 342 * 343 * {@internal Missing Long Description}} 344 * 345 * @since 2.7.0 353 346 * 354 347 * @param int|object $post An optional post. Global $post used if not provided. … … 371 364 372 365 /** 373 * Echo "sticky" CSS class if a post is sticky 374 * 375 * {@internal Missing Long Description}} 376 * 377 * @package WordPress 378 * @subpackage Post 379 * @since 2.7 366 * Display "sticky" CSS class, if a post is sticky. 367 * 368 * @since 2.7.0 380 369 * 381 370 * @param int $post_id An optional post ID … … 389 378 390 379 /** 391 * wp_link_pages() -{@internal Missing Short Description}}380 * {@internal Missing Short Description}} 392 381 * 393 382 * {@internal Missing Long Description}} … … 479 468 480 469 /** 481 * post_custom() - {@internal Missing Short Description}} 482 * 483 * {@internal Missing Long Description}} 470 * Retrieve post custom meta data field. 484 471 * 485 472 * @since 1.5.0 486 473 * 487 * @param unknown_type $key488 * @return unknown474 * @param string $key Meta data key name. 475 * @return string|array Array of values or single value, if only one element exists. 489 476 */ 490 477 function post_custom( $key = '' ) { … … 497 484 } 498 485 499 500 // this will probably change at some point... 501 /** 502 * the_meta() - {@internal Missing Short Description}} 503 * 504 * {@internal Missing Long Description}} 505 * 486 /** 487 * Display list of post custom fields. 488 * 489 * @internal This will probably change at some point... 506 490 * @since 1.2.0 507 * @uses apply_filters() 491 * @uses apply_filters() Calls 'the_meta_key' on list item HTML content, with key and value as separate parameters. 508 492 */ 509 493 function the_meta() { … … 528 512 529 513 /** 530 * wp_dropdown_pages() -{@internal Missing Short Description}}514 * {@internal Missing Short Description}} 531 515 * 532 516 * {@internal Missing Long Description}} … … 567 551 568 552 /** 569 * wp_list_pages() -{@internal Missing Short Description}}553 * {@internal Missing Short Description}} 570 554 * 571 555 * {@internal Missing Long Description}} … … 573 557 * @since 1.5.0 574 558 * 575 * @param unknown_type $args559 * @param array|string $args Optional. Override default arguments. 576 560 * @return unknown 577 561 */ … … 623 607 624 608 /** 625 * Create menu of pages609 * Display menu of pages. 626 610 * 627 611 * @since 2.7.0 … … 662 646 663 647 /** 664 * walk_page_tree() - {@internal Missing Short Description}} 665 * 666 * {@internal Missing Long Description}} 667 * 648 * Retrieve HTML list content for page list. 649 * 650 * @uses Walker_Page to create HTML list content. 668 651 * @since 2.1.0 669 * 670 * @return unknown 652 * @see Walker_Page::walk() for parameters and return description. 671 653 */ 672 654 function walk_page_tree() { … … 677 659 678 660 /** 679 * walk_page_dropdown_tree() - {@internal Missing Short Description}} 680 * 681 * {@internal Missing Long Description}} 682 * 661 * Retrieve HTML dropdown (select) content for page list. 662 * 663 * @uses Walker_PageDropdown to create HTML dropdown content. 683 664 * @since 2.1.0 684 * 685 * @return unknown 665 * @see Walker_PageDropdown::walk() for parameters and return description. 686 666 */ 687 667 function walk_page_dropdown_tree() { … … 696 676 697 677 /** 698 * the_attachment_link() -{@internal Missing Short Description}}678 * {@internal Missing Short Description}} 699 679 * 700 680 * {@internal Missing Long Description}} … … 713 693 } 714 694 715 // get an attachment page link using an image or icon if possible 695 /** 696 * Retrieve an attachment page link using an image or icon, if possible. 697 * 698 * {@internal Missing Long Description}} 699 * 700 * @since unknown 701 * 702 * @param unknown_type $id 703 * @param unknown_type $size 704 * @param unknown_type $permalink 705 * @param unknown_type $icon 706 * @return unknown 707 */ 716 708 function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) { 717 709 $id = intval($id); … … 734 726 } 735 727 736 // deprecated - use wp_get_attachment_link() 728 /** 729 * {@internal Missing Short Description}} 730 * 731 * {@internal Missing Long Description}} 732 * 733 * @since unknown 734 * @deprecated Use {@link wp_get_attachment_link()} 735 * @see wp_get_attachment_link() Use instead. 736 * 737 * @param unknown_type $id 738 * @param unknown_type $fullsize 739 * @param unknown_type $max_dims 740 * @param unknown_type $permalink 741 * @return unknown 742 */ 737 743 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 738 744 $id = (int) $id; … … 751 757 } 752 758 753 754 // deprecated: use wp_get_attachment_image_src() 755 /** 756 * get_attachment_icon_src() - {@internal Missing Short Description}} 759 /** 760 * {@internal Missing Short Description}} 757 761 * 758 762 * {@internal Missing Long Description}} 759 763 * 760 764 * @since 2.1.0 765 * @deprecated Use {@link wp_get_attachment_image_src()} 766 * @see wp_get_attachment_image_src() Use instead. 761 767 * 762 768 * @param unknown_type $id … … 795 801 } 796 802 797 // deprecated: use wp_get_attachment_image() 798 /** 799 * get_attachment_icon() - {@internal Missing Short Description}} 803 /** 804 * {@internal Missing Short Description}} 800 805 * 801 806 * {@internal Missing Long Description}} 802 807 * 803 808 * @since 2.0.0 809 * @deprecated Use {@link wp_get_attachment_image()} 810 * @see wp_get_attachment_image() Use instead of. 804 811 * 805 812 * @param unknown_type $id … … 851 858 } 852 859 853 // deprecated: use wp_get_attachment_image() 854 /** 855 * get_attachment_innerHTML() - {@internal Missing Short Description}} 860 /** 861 * {@internal Missing Short Description}} 856 862 * 857 863 * {@internal Missing Long Description}} 858 864 * 859 865 * @since 2.0.0 866 * @deprecated Use {@link wp_get_attachment_image()} 867 * @see wp_get_attachment_image() Use instead. 860 868 * 861 869 * @param unknown_type $id … … 879 887 880 888 /** 881 * prepend_attachment() -{@internal Missing Short Description}}889 * {@internal Missing Short Description}} 882 890 * 883 891 * {@internal Missing Long Description}} … … 908 916 909 917 /** 910 * get_the_password_form() - {@internal Missing Short Description}} 911 * 912 * {@internal Missing Long Description}} 918 * Retrieve protected post password form content. 913 919 * 914 920 * @since 1.0.0 915 * 916 * @return unknown 921 * @uses apply_filters() Calls 'the_password_form' filter on output. 922 * 923 * @return string HTML content for password form for password protected post. 917 924 */ 918 925 function get_the_password_form() { … … 928 935 929 936 /** 930 * is_page_template() - Determine wether or not we are in a page template931 * 932 * This template tag allows you to determine w ether or not you are in a page template.933 * You can optional provide a template name and then the check will be specific to934 * that template.937 * Whether currently in a page template. 938 * 939 * This template tag allows you to determine whether or not you are in a page 940 * template. You can optional provide a template name and then the check will be 941 * specific to that template. 935 942 * 936 943 * @since 2.5.0 937 944 * @uses $wp_query 938 945 * 939 * @param string $template The specific template name if specific matching is required 940 * @return bool False on failure, true if success 946 * @param string $template The specific template name if specific matching is required. 947 * @return bool False on failure, true if success. 941 948 */ 942 949 function is_page_template($template = '') { … … 964 971 965 972 /** 966 * wp_post_revision_title() - returns formatted datetimestamp of a revision (linked to that revisions's page)973 * Retrieve formatted date timestamp of a revision (linked to that revisions's page). 967 974 * 968 975 * @package WordPress 969 * @subpackage Post 970 * @since 2.6 976 * @subpackage Post_Revisions 977 * @since 2.6.0 971 978 * 972 979 * @uses date_i18n() 973 980 * 974 * @param int|object $revision revision ID or revision object975 * @param bool $link optionalLink to revisions's page?976 * @return string i18n formatted datetimestamp or localized 'C orrent Revision'981 * @param int|object $revision Revision ID or revision object. 982 * @param bool $link Optional, default is true. Link to revisions's page? 983 * @return string i18n formatted datetimestamp or localized 'Current Revision'. 977 984 */ 978 985 function wp_post_revision_title( $revision, $link = true ) { … … 1000 1007 1001 1008 /** 1002 * wp_list_post_revisions() - echoes list of a post's revisions 1003 * 1004 * Can output either a UL with edit links or a TABLE with diff interface, and restore action links 1009 * Display list of a post's revisions. 1010 * 1011 * Can output either a UL with edit links or a TABLE with diff interface, and 1012 * restore action links. 1005 1013 * 1006 1014 * Second argument controls parameters: 1007 * (bool) parent : include the parent (the "Current Revision") in the list 1008 * (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table' outputs TABLE with UI 1009 * (int) right : what revision is currently being viewed - used in form-table format 1010 * (int) left : what revision is currently being diffed against right - used in form-table format 1015 * (bool) parent : include the parent (the "Current Revision") in the list. 1016 * (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table' 1017 * outputs TABLE with UI. 1018 * (int) right : what revision is currently being viewed - used in 1019 * form-table format. 1020 * (int) left : what revision is currently being diffed against right - 1021 * used in form-table format. 1011 1022 * 1012 1023 * @package WordPress 1013 * @subpackage Post 1014 * @since 2.6 1024 * @subpackage Post_Revisions 1025 * @since 2.6.0 1015 1026 * 1016 1027 * @uses wp_get_post_revisions() … … 1019 1030 * @uses get_author_name() 1020 1031 * 1021 * @param int|object $post_id post ID or post object 1022 * @param string|array $args see description @see wp_parse_args() 1023 */ 1024 function wp_list_post_revisions( $post_id = 0, $args = null ) { // TODO? split into two functions (list, form-table) ? 1032 * @todo split into two functions (list, form-table) ? 1033 * 1034 * @param int|object $post_id Post ID or post object. 1035 * @param string|array $args See description {@link wp_parse_args()}. 1036 * @return null 1037 */ 1038 function wp_list_post_revisions( $post_id = 0, $args = null ) { 1025 1039 if ( !$post = get_post( $post_id ) ) 1026 1040 return;
Note: See TracChangeset
for help on using the changeset viewer.