diff --git a/includes/lib/class-wordpress-plugin-template-admin-api.php b/includes/lib/class-wordpress-plugin-template-admin-api.php
index 301c8c8..55a9705 100644
--- a/includes/lib/class-wordpress-plugin-template-admin-api.php
+++ b/includes/lib/class-wordpress-plugin-template-admin-api.php
@@ -58,7 +58,7 @@ public function display_field( $data = array(), $post = null, $echo = true ) {
// Get saved field data.
- $data = get_post_meta( $post->ID, $field['id'], true );
+ $data = get_post_meta( $post->ID, $option_name, true );
}
else {
@@ -78,6 +78,18 @@ public function display_field( $data = array(), $post = null, $echo = true ) {
$data = '';
}
+ // get attributes
+
+ $style = ( !empty($field['style']) ? ' style="'.$field['style'].'"' : '' );
+
+ $disabled = ( ( isset($field['disabled']) && $field['disabled'] === true ) ? ' disabled="disabled"' : '' );
+
+ $required = ( ( isset($field['required']) && $field['required'] === true ) ? ' required="true"' : '' );
+
+ $placeholder = ( isset($field['placeholder']) ? esc_attr($field['placeholder']) : '' );
+
+ // get html
+
$html = '';
switch ( $field['type'] ) {
@@ -86,7 +98,7 @@ public function display_field( $data = array(), $post = null, $echo = true ) {
case 'url':
case 'color':
case 'email':
- $html .= '' . "\n";
+ $html .= '' . "\n";
break;
case 'password':
@@ -101,15 +113,15 @@ public function display_field( $data = array(), $post = null, $echo = true ) {
if ( isset( $field['max'] ) ) {
$max = ' max="' . esc_attr( $field['max'] ) . '"';
}
- $html .= '' . "\n";
+ $html .= '' . "\n";
break;
case 'text_secret':
- $html .= '' . "\n";
+ $html .= '' . "\n";
break;
case 'textarea':
- $html .= '
' . "\n";
+ $html .= '
' . "\n";
break;
case 'checkbox':
@@ -136,13 +148,13 @@ public function display_field( $data = array(), $post = null, $echo = true ) {
if ( $k === $data ) {
$checked = true;
}
- $html .= ' ';
+ $html .= ' ';
}
break;
case 'select':
- $html .= '