Make WordPress Core


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

    r33605 r33891  
    265265 * @since 2.5.0
    266266 *
    267  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
     267 * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     268 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    268269 */
    269270function comment_guid($comment_id = null) {
     
    276277 * @since 2.5.0
    277278 *
    278  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
     279 * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     280 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    279281 * @return false|string false on failure or guid for comment on success.
    280282 */
Note: See TracChangeset for help on using the changeset viewer.