Function Reference: geodir_comment_rating_meta

Summary

Add comment rating meta box form fields.

Description

Adds form fields to the function {@see ‘geodir_comment_add_meta_box’}.

Package

GeoDirectory

Parameters

$comment
(object) (required) The comment object.

Default: None

Change Log

Since: 1.0.0

1.6.16 Changes for disable review stars for certain post type.

Source File

geodir_comment_rating_meta() is located in geodirectory-functions/comments_functions.php [Line: 68]

Source Code

function geodir_comment_rating_meta($comment) {
    $post_type = get_post_type($comment->comment_post_ID);
	if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0 && !(!empty($post_type) && geodir_cpt_has_rating_disabled($post_type))) {
		$rating = geodir_get_commentoverall($comment->comment_ID);
		
		if ((int)get_option('geodir_reviewrating_enable_font_awesome') == 1) {
			$star_texts = array();
			$star_texts[] = __('Terrible', 'geodirectory');
			$star_texts[] = __('Poor', 'geodirectory');
			$star_texts[] = __('Average', 'geodirectory');
			$star_texts[] = __('Very Good', 'geodirectory');
			$star_texts[] = __('Excellent', 'geodirectory');
			
			echo geodir_font_awesome_rating_form_html('', $star_texts, $rating);
		} else {			
			if ($rating) {
				echo '
'; } else { echo '
'; } } echo ''; } }