" name="fieldInputName); ?>[name]" id="fieldInputName); ?>[name]" required/>
" name="fieldInputName); ?>[nameForTotal]" id="fieldInputName); ?>[nameForTotal]"/>
" name="fieldInputName); ?>[desc]" id="fieldInputName); ?>[desc]"/>

fieldData["icon"] : "fas fa-star"); ?>" type="text" name="fieldInputName); ?>[icon]" id="fieldInputName); ?>[icon]"/>

fieldData["required"], 1, true); ?> name="fieldInputName); ?>[required]" id="fieldInputName); ?>[required]"/>
fieldData["is_show_on_comment"], 1, true); ?> name="fieldInputName); ?>[is_show_on_comment]" id="fieldInputName); ?>[is_show_on_comment]"/>
fieldData["show_for_guests"], 1, true); ?> name="fieldInputName); ?>[show_for_guests]" id="fieldInputName); ?>[show_for_guests]"/>
fieldData["show_for_users"], 1, true); ?> name="fieldInputName); ?>[show_for_users]" id="fieldInputName); ?>[show_for_users]"/>
comment_parent || !$this->isShowForUser($data)) { return ""; } $html = ""; $html .= ""; $html .= ""; $uniqueId = uniqid(); $required = $this->isValidateRequired($data) ? " wpd-required-group " : ""; $html .= "
"; $html .= "
"; for ($i = 5; $i >= 1; $i--) { $checked = ($i == $value) ? " checked='checked'" : ""; $html .= ""; $html .= ""; } $html .= "
"; $html .= "
"; $html .= ""; return $html; } public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) { if (!$isMainForm || !$this->isShowForUser($args, $currentUser)) return; $hasDesc = $args["desc"] ? true : false; $required = $args["required"] ? " wpd-required-group" : ""; $uniqueId = uniqid($uniqueId); ?>
">
= 1; $i--) { ?> " name="" value=""/>
isShowForUser($args)) { return ""; } $html = "
"; $html .= "
" . esc_html($args["name"]) . " :
"; for ($i = 0; $i < 5; $i++) { $colorClass = ($i < $value) ? " wcf-active-star " : " wcf-pasiv-star "; $fa = strpos(trim($args["icon"]), " ") ? $args["icon"] : "fas " . $args["icon"]; $html .= " "; } $html .= "
"; return $html; } public function validateFieldData($fieldName, $args, $options, $currentUser) { $value = Sanitizer::sanitize(INPUT_POST, $fieldName, FILTER_SANITIZE_NUMBER_INT); if ($this->isValidateRequired($args, $currentUser) && !$value && $args["required"]) { wp_die(esc_html__($args["name"], "wpdiscuz") . " : " . esc_html__("field is required!", "wpdiscuz")); } return $value; } protected function initDefaultData() { $this->fieldDefaultData = [ "name" => "", "nameForTotal" => "", "desc" => "", "required" => "0", "loc" => "top", "icon" => "fas fa-star", "is_show_on_comment" => 1, "show_for_guests" => 1, "show_for_users" => 1, ]; } }