Example #1
0
 /**
  * Render label for the property.
  */
 protected function render_label_html()
 {
     $title = $this->get_option('title');
     papi_render_html_tag('label', ['for' => $this->html_id(), 'title' => trim($title . ' ' . papi_require_text($this->get_options())), $title, papi_required_html($this->get_options())]);
 }
Example #2
0
/**
 * Get require tag for property.
 *
 * @param  stdClass $property
 * @param  bool     $text
 *
 * @return string
 */
function papi_required_html($property, $text = false)
{
    if (!papi_is_property($property) || !$property->required) {
        return '';
    }
    return ' <span class="papi-rq" data-property-name="' . $property->title . '" data-property-id="' . $property->slug . '">' . ($text ? papi_require_text($property) : '*') . '</span>';
}