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-includes/class-wp-xmlrpc-server.php

    r33885 r33891  
    10431043         * @since 3.4.0
    10441044         *
    1045          * @param array  $_comment An array of prepared comment data.
    1046          * @param object $comment  Comment object.
     1045         * @param array      $_comment An array of prepared comment data.
     1046         * @param WP_Comment $comment  Comment object.
    10471047         */
    10481048        return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );
Note: See TracChangeset for help on using the changeset viewer.