mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Comments: Remove wp_get_include_unapproved_comments_argument() for now.
The function seems too specific and low-level for an abstraction, is only used in two places, and does not provide a significant benefit in terms of reducing code duplication. Follow-up to [48133]. See #8973. git-svn-id: https://develop.svn.wordpress.org/trunk@48140 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1330,7 +1330,6 @@ function wp_comment_form_unfiltered_html_nonce() {
|
||||
* Will not try to get the comments if the post has none.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 5.5.0 Removed the need to use the $user_ID global.
|
||||
*
|
||||
* @global WP_Query $wp_query WordPress Query object.
|
||||
* @global WP_Post $post Global post object.
|
||||
@@ -1396,9 +1395,14 @@ function comments_template( $file = '/comments.php', $separate_comments = false
|
||||
$comment_args['hierarchical'] = false;
|
||||
}
|
||||
|
||||
$include_unapproved = wp_get_include_unapproved_comments_argument();
|
||||
if ( $include_unapproved ) {
|
||||
$comment_args['include_unapproved'] = $include_unapproved;
|
||||
if ( is_user_logged_in() ) {
|
||||
$comment_args['include_unapproved'] = array( get_current_user_id() );
|
||||
} else {
|
||||
$unapproved_email = wp_get_unapproved_comment_author_email();
|
||||
|
||||
if ( $unapproved_email ) {
|
||||
$comment_args['include_unapproved'] = array( $unapproved_email );
|
||||
}
|
||||
}
|
||||
|
||||
$per_page = 0;
|
||||
@@ -2097,7 +2101,7 @@ function wp_list_comments( $args = array(), $comments = null ) {
|
||||
);
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
$comment_args['include_unapproved'] = get_current_user_id();
|
||||
$comment_args['include_unapproved'] = array( get_current_user_id() );
|
||||
} else {
|
||||
$unapproved_email = wp_get_unapproved_comment_author_email();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user