get_option() === NULL ) {
$value = $this->default;
}
else {
$value = $this->get_option();
}
if ( $args["for_bank"] == true ) {
$value = $this->default;
}
echo '
';
if ( $this->prefix ) {
echo '' . $this->prefix . ' ';
}
echo ' min != NULL ) {
echo ' min="' . intval( $this->min ) . '"';
}
if ( $this->max != NULL ) {
echo ' max="' . intval( $this->max ) . '"';
}
if ( $this->step != NULL ) {
echo ' step="' . intval( $this->step ) . '"';
}
if ( $this->placeholder != '' ) {
echo ' placeholder="' . esc_attr( $this->placeholder ) . '"';
}
echo '>';
if ( $this->suffix ) {
echo '' . $this->suffix . ' ';
}
echo '
';
}
// Displayed after the form field
public function form_field_after ( $args ) {
$path_i = $this->get_level() * 2 + 1;
if ( $this->default !== NULL && $args["show_default"] == true ) {
echo '
(';
$text = '';
$text .= __( 'default:', 'tpl' ) . ' ';
if ( $this->default == 0 ) {
$text .= '0';
}
else {
$text .= tpl_kses( $this->format_option( $this->default ) );
}
echo $text;
echo ')
';
}
echo ''; // .tpl-field-inner
if ( $this->repeat !== false ) {
$this->path[$path_i]++;
}
echo '';
}
// Formats the option into value
public function format_option ( $value, $args = array() ) {
if ( !intval( $value ) ) {
return false;
}
if ( is_array( $value ) ) {
$value = $value[0];
}
else {
return $this->prefix . $value . $this->suffix;
}
}
}