Function Reference: geodir_comment_rating_fields

Summary

Add rating fields in comment form.

Description

Adds a rating input field in comment form.

Global Values

$post
(object) (required) The post object.

Default: None

Package

GeoDirectory

Change Log

Since: 1.0.0

1.6.16 Changes for disable review stars for certain post type.

Filters

‘gd_rating_form_html’ [Line: 121]

Source File

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

Source Code

function geodir_comment_rating_fields() {
    global $post;

    $post_types = geodir_get_posttypes();

    if (!empty($post->post_type) && in_array($post->post_type, $post_types) && !(!empty($post->post_type) && geodir_cpt_has_rating_disabled($post->post_type))) {
        $star_texts = array();
        $star_texts[] = __('Terrible', 'geodirectory');
        $star_texts[] = __('Poor', 'geodirectory');
        $star_texts[] = __('Average', 'geodirectory');
        $star_texts[] = __('Very Good', 'geodirectory');
        $star_texts[] = __('Excellent', 'geodirectory');
        
        $gd_rating_html = apply_filters('gd_rating_form_html', '
', $star_texts); echo $gd_rating_html; ?>