default;
}
else {
$value = esc_textarea( $this->get_option() );
}
echo '
';
if ( $this->prefix ) {
echo '' . $this->prefix . '';
}
echo '';
if ( $this->suffix ) {
echo '' . $this->suffix . '';
}
echo '
';
}
// Container end of the form field
public function form_field_after ( $args ) {
$path_i = $this->get_level() * 2 + 1;
if ( !empty( $this->default ) && $args["show_default"] == true ) {
echo '
(';
echo __( 'default:', 'tpl' ) . ' ' . esc_html( $this->default ) . '
';
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() ) {
return nl2br( $this->prefix . $value . $this->suffix );
}
// Echoes the value of the option
public function value ( $args = array(), $id = 0 ) {
if ( $this->repeat !== false ) {
$values = $this->get_value( $args, $id );
if ( is_array( $values ) ) {
echo '';
foreach ( $values as $value ) {
echo '- ' . tpl_kses( $value ) . '
';
}
echo '
';
return;
}
}
echo '' . tpl_kses( $this->get_value( $args, $id ) ) . '
';
}
}