mirror of
https://github.com/WordPress/WordPress.git
synced 2026-06-19 07:37:07 +00:00
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. Built from https://develop.svn.wordpress.org/trunk@33891 git-svn-id: http://core.svn.wordpress.org/trunk@33860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -146,8 +146,8 @@ $comment = get_comment( $comment_id );
|
||||
*
|
||||
* @since 3.4.0
|
||||
*
|
||||
* @param object $comment Comment object.
|
||||
* @param WP_User $user User object. The user may not exist.
|
||||
* @param WP_Comment $comment Comment object.
|
||||
* @param WP_User $user User object. The user may not exist.
|
||||
*/
|
||||
do_action( 'set_comment_cookies', $comment, $user );
|
||||
|
||||
@@ -158,8 +158,8 @@ $location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POS
|
||||
*
|
||||
* @since 2.0.5
|
||||
*
|
||||
* @param string $location The 'redirect_to' URI sent via $_POST.
|
||||
* @param object $comment Comment object.
|
||||
* @param string $location The 'redirect_to' URI sent via $_POST.
|
||||
* @param WP_Comment $comment Comment object.
|
||||
*/
|
||||
$location = apply_filters( 'comment_post_redirect', $location, $comment );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user