Class WC_Comments

Comments

Handle comments (reviews and order notes)

Package: WooCommerce\Classes\Products
Category: Class
Author: WooThemes
Version: 2.1.0
Class: WC_Post_types
Located at includes/class-wc-comments.php

Methods summary

public
# __construct( )

Constructor

Constructor

public static array
# exclude_order_comments( array $clauses )

Exclude order comments from queries and RSS

Exclude order comments from queries and RSS

This code should exclude shop_order comments from queries. Some queries (like the recent comments widget on the dashboard) are hardcoded and are not filtered, however, the code current_user_can( 'read_post', $comment->comment_post_ID ) should keep them safe since only admin and shop managers can view orders anyway.

The frontend view order pages get around this filter by using remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );

Parameters

$clauses
array
$clauses

Returns

array
public string
# exclude_order_comments_from_feed_join( string $join )

Exclude order comments from queries and RSS

Exclude order comments from queries and RSS

Parameters

$join
string
$join

Returns

string
public string
# exclude_order_comments_from_feed_where( string $where )

Exclude order comments from queries and RSS

Exclude order comments from queries and RSS

Parameters

$where
string
$where

Returns

string
public array
# check_comment_rating( array $comment_data )

Validate the comment ratings.

Validate the comment ratings.

Parameters

$comment_data
array
$comment_data

Returns

array
public
# add_comment_rating( mixed $comment_id )

Rating field for comments.

Rating field for comments.

Parameters

$comment_id
mixed
$comment_id
public
# clear_transients( mixed $comment_id )

Clear transients for a review.

Clear transients for a review.

Parameters

$comment_id
mixed
$comment_id

Magic methods summary

WooCommerce API documentation generated by ApiGen 2.8.0