Merge pull request #31004 from matt-h/review-filter
Add Product Reviews filter for `review` comment type.
This commit is contained in:
commit
a236bdca19
|
@ -46,6 +46,9 @@ class WC_Comments {
|
|||
// Support avatars for `review` comment type.
|
||||
add_filter( 'get_avatar_comment_types', array( __CLASS__, 'add_avatar_for_review_comment_type' ) );
|
||||
|
||||
// Add Product Reviews filter for `review` comment type.
|
||||
add_filter( 'admin_comment_types_dropdown', array( __CLASS__, 'add_review_comment_filter' ) );
|
||||
|
||||
// Review of verified purchase.
|
||||
add_action( 'comment_post', array( __CLASS__, 'add_comment_purchase_verification' ) );
|
||||
|
||||
|
@ -293,6 +296,20 @@ class WC_Comments {
|
|||
return array_merge( $comment_types, array( 'review' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Product Reviews filter for `review` comment type.
|
||||
*
|
||||
* @since 6.0.0
|
||||
*
|
||||
* @param array $comment_types Array of comment type labels keyed by their name.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function add_review_comment_filter( array $comment_types ): array {
|
||||
$comment_types['review'] = __( 'Product Reviews', 'woocommerce' );
|
||||
return $comment_types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a review is from a verified owner at submission.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue