WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/03/2015 06:16:35 PM (6 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/comment.php

    r32672 r33891  
    7575
    7676/**
    77  * Returns a comment object based on comment ID.
     77 * Returns a WP_Comment object based on comment ID.
    7878 *
    7979 * @since 2.0.0
    8080 *
    8181 * @param int $id ID of comment to retrieve.
    82  * @return object|false Comment if found. False on failure.
     82 * @return WP_Comment|false Comment if found. False on failure.
    8383 */
    8484function get_comment_to_edit( $id ) {
Note: See TracChangeset for help on using the changeset viewer.