Ticket #7550: 7550.r8969.diff
File 7550.r8969.diff, 9.5 KB (added by , 16 years ago) |
---|
-
comment-template.php
14 14 * If the comment has an empty comment_author field, then 'Anonymous' person is 15 15 * assumed. 16 16 * 17 * @since 1.5 17 * @since 1.5.0 18 18 * @uses apply_filters() Calls 'get_comment_author' hook on the comment author 19 19 * 20 20 * @return string The comment author … … 42 42 /** 43 43 * Retrieve the email of the author of the current comment. 44 44 * 45 * @since 1.5 45 * @since 1.5.0 46 46 * @uses apply_filters() Calls the 'get_comment_author_email' hook on the comment author email 47 47 * @uses $comment 48 48 * … … 100 100 /** 101 101 * Retrieve the html link to the url of the author of the current comment. 102 102 * 103 * @since 1.5 103 * @since 1.5.0 104 104 * @uses apply_filters() Calls 'get_comment_author_link' hook on the complete link HTML or author 105 105 * 106 106 * @return string Comment Author name or HTML link for author's URL … … 130 130 /** 131 131 * Retrieve the IP address of the author of the current comment. 132 132 * 133 * @since 1.5 133 * @since 1.5.0 134 134 * @uses $comment 135 135 * @uses apply_filters() 136 136 * … … 154 154 /** 155 155 * Retrieve the url of the author of the current comment. 156 156 * 157 * @since 1.5 157 * @since 1.5.0 158 158 * @uses apply_filters() Calls 'get_comment_author_url' hook on the comment author's URL 159 159 * 160 160 * @return string … … 185 185 * Encapsulate the HTML link between the $before and $after. So it will appear 186 186 * in the order of $before, link, and finally $after. 187 187 * 188 * @since 1.5 188 * @since 1.5.0 189 189 * @uses apply_filters() Calls the 'get_comment_author_url_link' on the complete HTML before returning. 190 190 * 191 191 * @param string $linktext The text to display instead of the comment author's email address … … 221 221 /** 222 222 * Generates semantic classes for each comment element 223 223 * 224 * @since 2.7 224 * @since 2.7.0 225 225 * 226 226 * @param string|array $class One or more classes to add to the class list 227 227 * @param int $comment_id An optional comment ID … … 239 239 /** 240 240 * Returns the classes for the comment div as an array 241 241 * 242 * @since 2.7 242 * @since 2.7.0 243 243 * 244 244 * @param string|array $class One or more classes to add to the class list 245 245 * @param int $comment_id An optional comment ID … … 308 308 /** 309 309 * Retrieve the comment date of the current comment. 310 310 * 311 * @since 1.5 311 * @since 1.5.0 312 312 * @uses apply_filters() Calls 'get_comment_date' hook with the formated date and the $d parameter respectively 313 313 * @uses $comment 314 314 * … … 342 342 * If the word count is less than 20, then no truncating is done and no '...' 343 343 * will appear. 344 344 * 345 * @since 1.5 345 * @since 1.5.0 346 346 * @uses $comment 347 347 * @uses apply_filters() Calls 'get_comment_excerpt' on truncated comment 348 348 * … … 370 370 /** 371 371 * Display the excerpt of the current comment. 372 372 * 373 * @since 1.2 373 * @since 1.2.0 374 374 * @uses apply_filters() Calls 'comment_excerpt' hook before displaying excerpt 375 375 */ 376 376 function comment_excerpt() { … … 380 380 /** 381 381 * Retrieve the comment id of the current comment. 382 382 * 383 * @since 1.5 383 * @since 1.5.0 384 384 * @uses $comment 385 385 * @uses apply_filters() Calls the 'get_comment_ID' hook for the comment ID 386 386 * … … 404 404 /** 405 405 * Retrieve the link to the current comment. 406 406 * 407 * @since 1.5 407 * @since 1.5.0 408 408 * @uses $comment 409 409 * 410 410 * @param object|string|int $comment Comment to retrieve. … … 418 418 /** 419 419 * Retrieves the link to the current post comments. 420 420 * 421 * @since 1.5 421 * @since 1.5.0 422 422 * 423 423 * @return string The link to the comments 424 424 */ … … 441 441 /** 442 442 * Retrieve the amount of comments a post has. 443 443 * 444 * @since 1.5 444 * @since 1.5.0 445 445 * @uses apply_filters() Calls the 'get_comments_number' hook on the number of comments 446 446 * 447 447 * @param int $post_id The Post ID … … 492 492 /** 493 493 * Retrieve the text of the current comment. 494 494 * 495 * @since 1.5 495 * @since 1.5.0 496 496 * @uses $comment 497 497 * 498 498 * @return string The comment content … … 516 516 /** 517 517 * Retrieve the comment time of the current comment. 518 518 * 519 * @since 1.5 519 * @since 1.5.0 520 520 * @uses $comment 521 521 * @uses apply_filter() Calls 'get_comment_time' hook with the formatted time, the $d parameter, and $gmt parameter passed. 522 522 * … … 548 548 /** 549 549 * Retrieve the comment type of the current comment. 550 550 * 551 * @since 1.5 551 * @since 1.5.0 552 552 * @uses $comment 553 553 * @uses apply_filters() Calls the 'get_comment_type' hook on the comment type 554 554 * … … 593 593 * retrieve the pretty path. If permalinks weren't enabled, the ID of the 594 594 * current post is used and appended to the correct page to go to. 595 595 * 596 * @since 1.5 596 * @since 1.5.0 597 597 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL 598 598 * @uses $id 599 599 * … … 650 650 /** 651 651 * Whether the current post is open for comments. 652 652 * 653 * @since 1.5 653 * @since 1.5.0 654 654 * @uses $post 655 655 * 656 656 * @param int $post_id An optional post ID to check instead of the current post. … … 667 667 /** 668 668 * Whether the current post is open for pings. 669 669 * 670 * @since 1.5 670 * @since 1.5.0 671 671 * @uses $post 672 672 * 673 673 * @param int $post_id An optional post ID to check instead of the current post. … … 691 691 * above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in 692 692 * the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0. 693 693 * 694 * @since 2.0.10 Backported to 2.0 branch 694 * Backported to 2.0.10. 695 * 695 696 * @since 2.1.3 696 697 * @uses $post Gets the ID of the current post for the token 697 698 */ … … 717 718 * default theme. If either does not exist, then the WordPress process will be 718 719 * halted. It is advised for that reason, that the default theme is not deleted. 719 720 * 720 * @since 1.5 721 * @since 1.5.0 721 722 * @global array $comment List of comment objects for the current post 722 723 * @uses $wpdb 723 724 * @uses $id … … 859 860 echo '</a>'; 860 861 } 861 862 863 /** 864 * Retrieve HTML content for reply to comment link. 865 * 866 * The default arguments that can be override are 'add_below', 'respond_id', 867 * 'reply_text', 'login_text', and 'depth'. The 'login_text' argument will be 868 * used, if the user must log in or register first before posting a comment. The 869 * 'reply_text' will be used, if they can post a reply. The 'add_below' and 870 * 'respond_id' arguments are for the JavaScript moveAddCommentForm() function 871 * parameters. 872 * 873 * @since 2.7.0 874 * 875 * @param array $args Optional. Override default options. 876 * @param int $comment Optional. Comment being replied to. 877 * @param int $post Optional. Post that the comment is going to be displayed on. 878 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed. 879 */ 862 880 function comment_reply_link($args = array(), $comment = null, $post = null) { 863 881 global $user_ID; 864 882 … … 888 906 return $link; 889 907 } 890 908 909 /** 910 * Display HTML content for cancel comment reply link. 911 * 912 * @since 2.7.0 913 * 914 * @param string $text Optional. Text to display for cancel reply. 915 * @param string $respond_id Optional. HTML ID attribute for JS cancelCommentReply function. 916 * @param string $respond_root Optional. Second parameter for JS cancelCommentReply function. 917 */ 891 918 function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') { 892 919 if ( empty($text) ) 893 920 $text = __('Click here to cancel reply.'); 894 921 echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>'; 895 922 } 896 923 924 /** 925 * HTML comment list class. 926 * 927 * @package WordPress 928 * @uses Walker 929 * @since unknown 930 */ 897 931 class Walker_Comment extends Walker { 932 /** 933 * @see Walker::$tree_type 934 * @since unknown 935 * @var string 936 */ 898 937 var $tree_type = 'comment'; 938 939 /** 940 * @see Walker::$db_fields 941 * @since unknown 942 * @var array 943 */ 899 944 var $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID'); 900 945 946 /** 947 * @see Walker::start_lvl() 948 * @since unknown 949 * 950 * @param string $output Passed by reference. Used to append additional content. 951 * @param int $depth Depth of comment. 952 * @param array $args Uses 'style' argument for type of HTML list. 953 */ 901 954 function start_lvl(&$output, $depth, $args) { 902 955 $GLOBALS['comment_depth'] = $depth + 1; 903 956 … … 914 967 } 915 968 } 916 969 970 /** 971 * @see Walker::end_lvl() 972 * @since unknown 973 * 974 * @param string $output Passed by reference. Used to append additional content. 975 * @param int $depth Depth of comment. 976 * @param array $args Will only append content if style argument value is 'ol' or 'ul'. 977 */ 917 978 function end_lvl(&$output, $depth, $args) { 918 979 $GLOBALS['comment_depth'] = $depth + 1; 919 980 … … 930 991 } 931 992 } 932 993 994 /** 995 * @see Walker::start_el() 996 * @since unknown 997 * 998 * @param string $output Passed by reference. Used to append additional content. 999 * @param object $comment Comment data object. 1000 * @param int $depth Depth of comment in reference to parents. 1001 * @param array $args 1002 */ 933 1003 function start_el(&$output, $comment, $depth, $args) { 934 1004 $depth++; 935 1005 $GLOBALS['comment_depth'] = $depth; … … 976 1046 <?php 977 1047 } 978 1048 1049 /** 1050 * @see Walker::end_el() 1051 * @since unknown 1052 * 1053 * @param string $output Passed by reference. Used to append additional content. 1054 * @param object $comment 1055 * @param int $depth Depth of comment. 1056 * @param array $args 1057 */ 979 1058 function end_el(&$output, $comment, $depth, $args) { 980 1059 if ( !empty($args['end-callback']) ) { 981 1060 call_user_func($args['end-callback'], $comment, $args, $depth); … … 994 1073 * 995 1074 * Used in the comments.php template to list comments for a particular post 996 1075 * 997 * @since 2.7 1076 * @since 2.7.0 998 1077 * @uses Walker_Comment 999 1078 * 1000 1079 * @param $args string|array Formatting options