Make WordPress Core

Ticket #7550: 7550.r8969.diff

File 7550.r8969.diff, 9.5 KB (added by jacobsantos, 16 years ago)

Completion of comment-template.php again based off of r8969

  • comment-template.php

     
    1414 * If the comment has an empty comment_author field, then 'Anonymous' person is
    1515 * assumed.
    1616 *
    17  * @since 1.5
     17 * @since 1.5.0
    1818 * @uses apply_filters() Calls 'get_comment_author' hook on the comment author
    1919 *
    2020 * @return string The comment author
     
    4242/**
    4343 * Retrieve the email of the author of the current comment.
    4444 *
    45  * @since 1.5
     45 * @since 1.5.0
    4646 * @uses apply_filters() Calls the 'get_comment_author_email' hook on the comment author email
    4747 * @uses $comment
    4848 *
     
    100100/**
    101101 * Retrieve the html link to the url of the author of the current comment.
    102102 *
    103  * @since 1.5
     103 * @since 1.5.0
    104104 * @uses apply_filters() Calls 'get_comment_author_link' hook on the complete link HTML or author
    105105 *
    106106 * @return string Comment Author name or HTML link for author's URL
     
    130130/**
    131131 * Retrieve the IP address of the author of the current comment.
    132132 *
    133  * @since 1.5
     133 * @since 1.5.0
    134134 * @uses $comment
    135135 * @uses apply_filters()
    136136 *
     
    154154/**
    155155 * Retrieve the url of the author of the current comment.
    156156 *
    157  * @since 1.5
     157 * @since 1.5.0
    158158 * @uses apply_filters() Calls 'get_comment_author_url' hook on the comment author's URL
    159159 *
    160160 * @return string
     
    185185 * Encapsulate the HTML link between the $before and $after. So it will appear
    186186 * in the order of $before, link, and finally $after.
    187187 *
    188  * @since 1.5
     188 * @since 1.5.0
    189189 * @uses apply_filters() Calls the 'get_comment_author_url_link' on the complete HTML before returning.
    190190 *
    191191 * @param string $linktext The text to display instead of the comment author's email address
     
    221221/**
    222222 * Generates semantic classes for each comment element
    223223 *
    224  * @since 2.7
     224 * @since 2.7.0
    225225 *
    226226 * @param string|array $class One or more classes to add to the class list
    227227 * @param int $comment_id An optional comment ID
     
    239239/**
    240240 * Returns the classes for the comment div as an array
    241241 *
    242  * @since 2.7
     242 * @since 2.7.0
    243243 *
    244244 * @param string|array $class One or more classes to add to the class list
    245245 * @param int $comment_id An optional comment ID
     
    308308/**
    309309 * Retrieve the comment date of the current comment.
    310310 *
    311  * @since 1.5
     311 * @since 1.5.0
    312312 * @uses apply_filters() Calls 'get_comment_date' hook with the formated date and the $d parameter respectively
    313313 * @uses $comment
    314314 *
     
    342342 * If the word count is less than 20, then no truncating is done and no '...'
    343343 * will appear.
    344344 *
    345  * @since 1.5
     345 * @since 1.5.0
    346346 * @uses $comment
    347347 * @uses apply_filters() Calls 'get_comment_excerpt' on truncated comment
    348348 *
     
    370370/**
    371371 * Display the excerpt of the current comment.
    372372 *
    373  * @since 1.2
     373 * @since 1.2.0
    374374 * @uses apply_filters() Calls 'comment_excerpt' hook before displaying excerpt
    375375 */
    376376function comment_excerpt() {
     
    380380/**
    381381 * Retrieve the comment id of the current comment.
    382382 *
    383  * @since 1.5
     383 * @since 1.5.0
    384384 * @uses $comment
    385385 * @uses apply_filters() Calls the 'get_comment_ID' hook for the comment ID
    386386 *
     
    404404/**
    405405 * Retrieve the link to the current comment.
    406406 *
    407  * @since 1.5
     407 * @since 1.5.0
    408408 * @uses $comment
    409409 *
    410410 * @param object|string|int $comment Comment to retrieve.
     
    418418/**
    419419 * Retrieves the link to the current post comments.
    420420 *
    421  * @since 1.5
     421 * @since 1.5.0
    422422 *
    423423 * @return string The link to the comments
    424424 */
     
    441441/**
    442442 * Retrieve the amount of comments a post has.
    443443 *
    444  * @since 1.5
     444 * @since 1.5.0
    445445 * @uses apply_filters() Calls the 'get_comments_number' hook on the number of comments
    446446 *
    447447 * @param int $post_id The Post ID
     
    492492/**
    493493 * Retrieve the text of the current comment.
    494494 *
    495  * @since 1.5
     495 * @since 1.5.0
    496496 * @uses $comment
    497497 *
    498498 * @return string The comment content
     
    516516/**
    517517 * Retrieve the comment time of the current comment.
    518518 *
    519  * @since 1.5
     519 * @since 1.5.0
    520520 * @uses $comment
    521521 * @uses apply_filter() Calls 'get_comment_time' hook with the formatted time, the $d parameter, and $gmt parameter passed.
    522522 *
     
    548548/**
    549549 * Retrieve the comment type of the current comment.
    550550 *
    551  * @since 1.5
     551 * @since 1.5.0
    552552 * @uses $comment
    553553 * @uses apply_filters() Calls the 'get_comment_type' hook on the comment type
    554554 *
     
    593593 * retrieve the pretty path. If permalinks weren't enabled, the ID of the
    594594 * current post is used and appended to the correct page to go to.
    595595 *
    596  * @since 1.5
     596 * @since 1.5.0
    597597 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL
    598598 * @uses $id
    599599 *
     
    650650/**
    651651 * Whether the current post is open for comments.
    652652 *
    653  * @since 1.5
     653 * @since 1.5.0
    654654 * @uses $post
    655655 *
    656656 * @param int $post_id An optional post ID to check instead of the current post.
     
    667667/**
    668668 * Whether the current post is open for pings.
    669669 *
    670  * @since 1.5
     670 * @since 1.5.0
    671671 * @uses $post
    672672 *
    673673 * @param int $post_id An optional post ID to check instead of the current post.
     
    691691 * above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in
    692692 * the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0.
    693693 *
    694  * @since 2.0.10 Backported to 2.0 branch
     694 * Backported to 2.0.10.
     695 *
    695696 * @since 2.1.3
    696697 * @uses $post Gets the ID of the current post for the token
    697698 */
     
    717718 * default theme. If either does not exist, then the WordPress process will be
    718719 * halted. It is advised for that reason, that the default theme is not deleted.
    719720 *
    720  * @since 1.5
     721 * @since 1.5.0
    721722 * @global array $comment List of comment objects for the current post
    722723 * @uses $wpdb
    723724 * @uses $id
     
    859860        echo '</a>';
    860861}
    861862
     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 */
    862880function comment_reply_link($args = array(), $comment = null, $post = null) {
    863881        global $user_ID;
    864882
     
    888906        return $link;
    889907}
    890908
     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 */
    891918function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') {
    892919        if ( empty($text) )
    893920                $text = __('Click here to cancel reply.');
    894921        echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>';
    895922}
    896923
     924/**
     925 * HTML comment list class.
     926 *
     927 * @package WordPress
     928 * @uses Walker
     929 * @since unknown
     930 */
    897931class Walker_Comment extends Walker {
     932        /**
     933         * @see Walker::$tree_type
     934         * @since unknown
     935         * @var string
     936         */
    898937        var $tree_type = 'comment';
     938
     939        /**
     940         * @see Walker::$db_fields
     941         * @since unknown
     942         * @var array
     943         */
    899944        var $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID');
    900945
     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         */
    901954        function start_lvl(&$output, $depth, $args) {
    902955                $GLOBALS['comment_depth'] = $depth + 1;
    903956
     
    914967                }
    915968        }
    916969
     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         */
    917978        function end_lvl(&$output, $depth, $args) {
    918979                $GLOBALS['comment_depth'] = $depth + 1;
    919980
     
    930991                }
    931992        }
    932993
     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         */
    9331003        function start_el(&$output, $comment, $depth, $args) {
    9341004                $depth++;
    9351005                $GLOBALS['comment_depth'] = $depth;
     
    9761046<?php
    9771047        }
    9781048
     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         */
    9791058        function end_el(&$output, $comment, $depth, $args) {
    9801059                if ( !empty($args['end-callback']) ) {
    9811060                        call_user_func($args['end-callback'], $comment, $args, $depth);
     
    9941073 *
    9951074 * Used in the comments.php template to list comments for a particular post
    9961075 *
    997  * @since 2.7
     1076 * @since 2.7.0
    9981077 * @uses Walker_Comment
    9991078 *
    10001079 * @param $args string|array Formatting options