From ec028206bbcf8edce9545084519e1a6a69f736a0 Mon Sep 17 00:00:00 2001 From: Jay Wood Date: Fri, 30 Sep 2016 12:23:27 -0400 Subject: [PATCH] Add textarea field type --- includes/settings.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/includes/settings.php b/includes/settings.php index 7255caa..23e8bdf 100644 --- a/includes/settings.php +++ b/includes/settings.php @@ -178,6 +178,31 @@ class CWV2_Settings { public function textbox( $args = array() ) { + $args = $this->get_default_args( $args ); + + $field_id = $args['id']; + $description = $args['desc']; + $default = empty( $args['default'] ) ? '' : $args['default']; + $options = empty( $args['options'] ) ? array() : $args['options']; + if ( empty( $field_id ) ) { + return; + } + + $option_value = get_option( $field_id, $field_id, $default ); + + $attributes = ''; + + if ( ! empty( $options ) ) { + foreach ( $options as $k => $v ) { + $attributes .= $k . '="' . $v . '"'; + } + } + + ?>