PHP 클래스 WC_Comments

Handle comments (reviews and order notes)
저자: WooThemes
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 메소드들

메소드 설명
add_avatar_for_review_comment_type ( array $comment_types ) : array Make sure WP displays avatars for comments with the review type.
add_comment_purchase_verification ( integer $comment_id ) : boolean Determine if a review is from a verified owner at submission.
add_comment_rating ( integer $comment_id ) Rating field for comments.
check_comment_rating ( array $comment_data ) : array Validate the comment ratings.
clear_transients ( integer $post_id ) Ensure product average rating and review count is kept up to date.
comment_moderation_recipients ( array $emails, integer $comment_id ) : array Modify recipient of review email.
delete_comments_count_cache ( ) : void Delete comments count cache whenever there is new comment or the status of a comment changes. Cache will be regenerated next time WC_Comments::wp_count_comments() is called.
exclude_order_comments ( array $clauses ) : array Exclude order comments from queries and RSS.
exclude_order_comments_from_feed_join ( string $join ) : string Exclude order comments from queries and RSS.
exclude_order_comments_from_feed_where ( string $where ) : string Exclude order comments from queries and RSS.
exclude_webhook_comments ( array $clauses ) : array Exclude webhook comments from queries and RSS.
exclude_webhook_comments_from_feed_join ( string $join ) : string Exclude webhook comments from queries and RSS.
exclude_webhook_comments_from_feed_where ( string $where ) : string Exclude webhook comments from queries and RSS.
get_average_rating_for_product ( WC_Product &$product ) : float Get product rating for a product. Please note this is not cached.
get_rating_counts_for_product ( WC_Product &$product ) : array Get product rating count for a product. Please note this is not cached.
get_review_count_for_product ( WC_Product &$product ) : integer Get product review count for a product (not replies). Please note this is not cached.
init ( ) Hook in methods.
wp_count_comments ( object $stats, integer $post_id ) : object Remove order notes and webhook delivery logs from wp_count_comments().

메소드 상세

add_avatar_for_review_comment_type() 공개 정적인 메소드

Make sure WP displays avatars for comments with the review type.
부터: 2.3
public static add_avatar_for_review_comment_type ( array $comment_types ) : array
$comment_types array
리턴 array

add_comment_purchase_verification() 공개 정적인 메소드

Determine if a review is from a verified owner at submission.
public static add_comment_purchase_verification ( integer $comment_id ) : boolean
$comment_id integer
리턴 boolean

add_comment_rating() 공개 정적인 메소드

Rating field for comments.
public static add_comment_rating ( integer $comment_id )
$comment_id integer

check_comment_rating() 공개 정적인 메소드

Validate the comment ratings.
public static check_comment_rating ( array $comment_data ) : array
$comment_data array
리턴 array

clear_transients() 공개 정적인 메소드

Ensure product average rating and review count is kept up to date.
public static clear_transients ( integer $post_id )
$post_id integer

comment_moderation_recipients() 공개 정적인 메소드

Modify recipient of review email.
public static comment_moderation_recipients ( array $emails, integer $comment_id ) : array
$emails array
$comment_id integer
리턴 array

delete_comments_count_cache() 공개 정적인 메소드

Delete comments count cache whenever there is new comment or the status of a comment changes. Cache will be regenerated next time WC_Comments::wp_count_comments() is called.
public static delete_comments_count_cache ( ) : void
리턴 void

exclude_order_comments() 공개 정적인 메소드

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 );
public static exclude_order_comments ( array $clauses ) : array
$clauses array
리턴 array

exclude_order_comments_from_feed_join() 공개 정적인 메소드

Exclude order comments from queries and RSS.
public static exclude_order_comments_from_feed_join ( string $join ) : string
$join string
리턴 string

exclude_order_comments_from_feed_where() 공개 정적인 메소드

Exclude order comments from queries and RSS.
public static exclude_order_comments_from_feed_where ( string $where ) : string
$where string
리턴 string

exclude_webhook_comments() 공개 정적인 메소드

Exclude webhook comments from queries and RSS.
부터: 2.2
public static exclude_webhook_comments ( array $clauses ) : array
$clauses array
리턴 array

exclude_webhook_comments_from_feed_join() 공개 정적인 메소드

Exclude webhook comments from queries and RSS.
부터: 2.2
public static exclude_webhook_comments_from_feed_join ( string $join ) : string
$join string
리턴 string

exclude_webhook_comments_from_feed_where() 공개 정적인 메소드

Exclude webhook comments from queries and RSS.
부터: 2.1
public static exclude_webhook_comments_from_feed_where ( string $where ) : string
$where string
리턴 string

get_average_rating_for_product() 공개 정적인 메소드

Get product rating for a product. Please note this is not cached.
부터: 2.7.0
public static get_average_rating_for_product ( WC_Product &$product ) : float
$product WC_Product
리턴 float

get_rating_counts_for_product() 공개 정적인 메소드

Get product rating count for a product. Please note this is not cached.
부터: 2.7.0
public static get_rating_counts_for_product ( WC_Product &$product ) : array
$product WC_Product
리턴 array of integers

get_review_count_for_product() 공개 정적인 메소드

Get product review count for a product (not replies). Please note this is not cached.
부터: 2.7.0
public static get_review_count_for_product ( WC_Product &$product ) : integer
$product WC_Product
리턴 integer

init() 공개 정적인 메소드

Hook in methods.
public static init ( )

wp_count_comments() 공개 정적인 메소드

Remove order notes and webhook delivery logs from wp_count_comments().
부터: 2.2
public static wp_count_comments ( object $stats, integer $post_id ) : object
$stats object Comment stats.
$post_id integer Post ID.
리턴 object