comment_parent || !$this->isShowForUser($data)) {
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,
];
}
}