Make WordPress Core


Ignore:
Timestamp:
09/09/2015 02:33:19 AM (9 years ago)
Author:
wonderboymusic
Message:

After [33891], a lot of comment functions can take WP_Comment instead of only accepting comment_ID. Update the @param docs to reflect this.

See #33638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r33925 r33961  
    1717 * @since 1.5.0
    1818 *
    19  * @param int $comment_ID Optional. The ID of the comment for which to retrieve the author. Default current comment.
     19 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author.
     20 *                                   Default current comment.
    2021 * @return string The comment author
    2122 */
     
    5051 * @since 0.71
    5152 *
    52  * @param int $comment_ID Optional. The ID of the comment for which to print the author. Default current comment.
     53 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.
     54 *                                   Default current comment.
    5355 */
    5456function comment_author( $comment_ID = 0 ) {
     
    7274 * @since 1.5.0
    7375 *
    74  * @param int $comment_ID Optional. The ID of the comment for which to get the author's email. Default current comment.
     76 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email.
     77 *                                   Default current comment.
    7578 * @return string The current comment author's email
    7679 */
     
    102105 * @since 0.71
    103106 *
    104  * @param int $comment_ID Optional. The ID of the comment for which to print the author's email. Default current comment.
     107 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
     108 *                                   Default current comment.
    105109 */
    106110function comment_author_email( $comment_ID = 0 ) {
     
    194198 * @since 1.5.0
    195199 *
    196  * @param int $comment_ID ID of the comment for which to get the author's link.
    197  *                        Default current comment.
     200 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link.
     201 *                                  Default current comment.
    198202 * @return string The comment author name or HTML link for author's URL.
    199203 */
     
    226230 * @since 0.71
    227231 *
    228  * @param int $comment_ID ID of the comment for which to print the author's
    229  *                        link. Default current comment.
     232 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.
     233 *                                  Default current comment.
    230234 */
    231235function comment_author_link( $comment_ID = 0 ) {
     
    238242 * @since 1.5.0
    239243 *
    240  * @param int $comment_ID ID of the comment for which to get the author's IP
    241  *                        address. Default current comment.
     244 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address.
     245 *                                  Default current comment.
    242246 * @return string Comment author's IP address.
    243247 */
     
    263267 * @since 0.71
    264268 *
    265  * @param int $comment_ID ID of the comment for which to print the author's IP
    266  *                        address. Default current comment.
     269 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
     270 *                                  Default current comment.
    267271 */
    268272function comment_author_IP( $comment_ID = 0 ) {
     
    275279 * @since 1.5.0
    276280 *
    277  * @param int $comment_ID ID of the comment for which to get the author's URL.
    278  *                        Default current comment.
     281 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL.
     282 *                                  Default current comment.
    279283 * @return string
    280284 */
     
    302306 * @since 0.71
    303307 *
    304  * @param int $comment_ID ID of the comment for which to print the author's URL.
    305  *                        Default current comment.
     308 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.
     309 *                                  Default current comment.
    306310 */
    307311function comment_author_url( $comment_ID = 0 ) {
     
    383387 * @since 2.7.0
    384388 *
    385  * @param string|array $class      Optional. One or more classes to add to the class list.
     389 * @param string|array   $class    Optional. One or more classes to add to the class list.
    386390 *                                 Default empty.
    387  * @param int          $comment_id Comment ID. Default current comment.
    388  * @param int|WP_Post  $post_id    Post ID or WP_Post object. Default current post.
    389  * @param bool         $echo       Optional. Whether to cho or return the output.
     391 * @param int|WP_Comment $comment  Comment ID or WP_Comment object. Default current comment.
     392 * @param int|WP_Post    $post_id  Post ID or WP_Post object. Default current post.
     393 * @param bool           $echo     Optional. Whether to cho or return the output.
    390394 *                                 Default true.
    391395 * @return string|void
    392396 */
    393 function comment_class( $class = '', $comment_id = null, $post_id = null, $echo = true ) {
     397function comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) {
    394398    // Separates classes with a single space, collates classes for comment DIV
    395     $class = 'class="' . join( ' ', get_comment_class( $class, $comment_id, $post_id ) ) . '"';
     399    $class = 'class="' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"';
    396400    if ( $echo)
    397401        echo $class;
     
    409413 * @global int $comment_thread_alt
    410414 *
    411  * @param string|array $class      Optional. One or more classes to add to the class list. Default empty.
    412  * @param int          $comment_id Comment ID. Default current comment.
    413  * @param int|WP_Post  $post_id    Post ID or WP_Post object. Default current post.
     415 * @param string|array   $class      Optional. One or more classes to add to the class list. Default empty.
     416 * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. Default current comment.
     417 * @param int|WP_Post    $post_id    Post ID or WP_Post object. Default current post.
    414418 * @return array An array of classes.
    415419 */
     
    492496 * @since 1.5.0
    493497 *
    494  * @param string $d          Optional. The format of the date. Default user's setting.
    495  * @param int    $comment_ID ID of the comment for which to get the date. Default current comment.
     498 * @param string          $d          Optional. The format of the date. Default user's setting.
     499 * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to get the date.
     500 *                                    Default current comment.
    496501 * @return string The comment's date.
    497502 */
     
    519524 * @since 0.71
    520525 *
    521  * @param string $d          Optional. The format of the date. Default user's settings.
    522  * @param int    $comment_ID ID of the comment for which to print the date. Default current comment.
     526 * @param string          $d          Optional. The format of the date. Default user's settings.
     527 * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to print the date.
     528 *                                    Default current comment.
    523529 */
    524530function comment_date( $d = '', $comment_ID = 0 ) {
     
    535541 * @since 1.5.0
    536542 *
    537  * @param int $comment_ID ID of the comment for which to get the excerpt.
    538  *                        Default current comment.
     543 * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to get the excerpt.
     544 *                                    Default current comment.
    539545 * @return string The maybe truncated comment with 20 words or less.
    540546 */
     
    576582 * @since 1.2.0
    577583 *
    578  * @param int $comment_ID ID of the comment for which to print the excerpt.
    579  *                        Default current comment.
     584 * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to print the excerpt.
     585 *                                    Default current comment.
    580586 */
    581587function comment_excerpt( $comment_ID = 0 ) {
     
    812818 * @see Walker_Comment::comment()
    813819 *
    814  * @param int   $comment_ID ID of the comment for which to get the text. Default current comment.
    815  * @param array $args       Optional. An array of arguments. Default empty.
     820 * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to get the text.
     821 *                                    Default current comment.
     822 * @param array           $args       Optional. An array of arguments. Default empty.
    816823 * @return string The comment content.
    817824 */
     
    840847 * @see Walker_Comment::comment()
    841848 *
    842  * @param int   $comment_ID ID of the comment for which to print the text. Default 0.
    843  * @param array $args       Optional. An array of arguments. Default empty array. Default empty.
     849 * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to print the text.
     850 *                                    Default current comment.
     851 * @param array           $args       Optional. An array of arguments. Default empty array. Default empty.
    844852 */
    845853function comment_text( $comment_ID = 0, $args = array() ) {
     
    912920 * @since 1.5.0
    913921 *
    914  * @param int $comment_ID ID of the comment for which to get the type. Default current comment.
     922 * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to get the type.
     923 *                                    Default current comment.
    915924 * @return string The comment type.
    916925 */
Note: See TracChangeset for help on using the changeset viewer.