Make WordPress Core


Ignore:
Timestamp:
09/03/2015 06:16:35 PM (10 years ago)
Author:
wonderboymusic
Message:

Introduce WP_Comment class to model/strongly-type rows from the comments database table. Inclusion of this class is a pre-req for some more general comment cleanup and sanity.

  • Takes inspiration from WP_Post and adds sanity to comment caching.
  • Clarifies when the current global value for $comment is returned. The current implementation in get_comment() introduces side effects and an occasion stale global value for $comment when comment caches are cleaned.
  • Strongly-types @param docs
  • This class is marked final for now

Props wonderboymusic, nacin.

See #32619.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r33833 r33891  
    549549
    550550/**
    551  * @global object $comment
    552  *
    553  * @param object $comment
    554  * @param bool   $show_date
     551 * @global WP_Comment $comment
     552 *
     553 * @param WP_Comment $comment
     554 * @param bool       $show_date
    555555 */
    556556function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
     
    604604         * @since 2.6.0
    605605         *
    606          * @param array  $actions An array of comment actions. Default actions include:
    607          *                        'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
    608          *                        'Delete', and 'Trash'.
    609          * @param object $comment The comment object.
     606         * @param array      $actions An array of comment actions. Default actions include:
     607         *                            'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
     608         *                            'Delete', and 'Trash'.
     609         * @param WP_Comment $comment The comment object.
    610610         */
    611611        $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
Note: See TracChangeset for help on using the changeset viewer.