function ct_is_tour_enabled() { return apply_filters('ct_is_tour_enabled', in_array('tour', ct_get_available_modules())); }
function ct_get_review_rating_fields($post_id = '', $default_rating = array()) { global $ct_options; $post_type = ''; if (!empty($post_id)) { $post_type = get_post_type($post_id); } else { $available_modules = ct_get_available_modules(); $post_type = empty($available_modules) ? '' : $available_modules[0]; } $review_fields = array(); if ('hotel' == $post_type) { $review_fields = !empty($ct_options['hotel_review_fields']) ? explode(",", $ct_options['hotel_review_fields']) : array("Position", "Comfort", "Price", "Quality"); } elseif ('tour' == $post_type) { $review_fields = !empty($ct_options['tour_review_fields']) ? explode(",", $ct_options['tour_review_fields']) : array("Position", "Tourist guide", "Price", "Quality"); } $i = 0; foreach ($review_fields as $review_field) { ?> <tr> <th><?php esc_html_e($review_field, 'citytours'); ?> </th> <td><input type="number" name="review_rating_detail[<?php echo esc_attr($i); ?> ]" min="1" max="5" value="<?php echo esc_attr(isset($default_rating[$i]) ? $default_rating[$i] : 5); ?> "></td> </tr> <?php $i++; } }