AnsPress_Comment_Hooks::comments_template_query_args( array $args )

Description #

Modify comment query args for showing pending comments to moderator.

Parameters #

  • $args
    array (Required) Comment args.

Changelog #

VersionDescription
3.0.0Introduced.

Source #

File: includes/comments.php

104
105
106
107
108
109
110
111
112
113
114
115
116
public static function comments_template_query_args( $args ) {
    global $question_rendered;
 
    if ( true === $question_rendered && is_singular( 'question' ) ) {
        return false;
    }
 
    if ( ap_user_can_approve_comment() ) {
        $args['status'] = 'all';
    }
 
    return $args;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment