Ejemplo n.º 1
0
                                            </ul>
                                            <input name="comment_rate" class="comment_rate" type="hidden">
                                        </div>';
$comment_form['comment_field'] .= '<div class="form-group">
                                    <label>' . st_get_language('review_title') . '</label>
                                    <input class="form-control" type="text" name="comment_title">
                                </div>';
$comment_form['comment_field'] .= '<div class="form-group">
                                    <label>' . st_get_language('review_text') . '</label>
                                    <textarea name="comment" id="comment" class="form-control" rows="6"></textarea>
                                </div>

                                ';
/* comment message for user and guest */
$comment_form_arg = apply_filters(get_post_type($item_id) . '_wp_review_form_args', $comment_form, $item_id);
$review_check = STReview::review_check($item_id);
switch ($review_check) {
    case "true":
        echo '<div class="box bg-gray">';
        comment_form($comment_form_arg);
        echo "</div>";
        break;
    case "must_login":
        echo '<div class="box bg-gray">';
        $login_link = get_the_permalink(st()->get_option('page_user_login'));
        echo sprintf(st_get_language('you_must') . '<a href="' . $login_link . '">' . __('log in ', ST_TEXTDOMAIN) . '</a>' . st_get_language('to_write_review'), get_permalink(st()->get_option('user_login_page')));
        echo '</div>';
        break;
    case "need_open":
        echo '<div class="box bg-gray">';
        echo sprintf(__("Review is disabled from administrator", ST_TEXTDOMAIN));