My code is here.The other options working perfectly so how i can register the image and save the link in database and image in wp library.
function register_team_show_case_setting() {
//register our settings
register_setting('my_team_show_case_setting', 'layout');
register_setting('my_team_show_case_setting', 'color');
register_setting('my_team_show_case_setting', 'image');
}
function submenu_callback() {
?>
<div class="wrap">
<h2>Team Showcase Setting</h2>
<form method="post" action="options.php">
<?php settings_fields('my_team_show_case_setting'); ?>
<?php do_settings_sections('my_team_show_case_setting'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">Layout</th>
<td>
<select class="select-box" name="layout" value="<?php echo esc_attr(get_option('layout')); ?> class="form-control">
<option></option>
<option value="Grid" <?php if (get_option('layout') == "Grid") echo 'selected="selected"'; ?>>Grid</option>
<option value="Grid-without-tab" <?php if (get_option('layout') == "Grid-without-tab") echo 'selected="selected"'; ?>>Grid-without-tab</option>
<option value="Row" <?php if (get_option('layout') == "Row") echo 'selected="selected"'; ?>>Row</option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">Color Schema</th>
<td>
<select class="select-box" name="color" value="<?php echo esc_attr(get_option('color')); ?> class="form-control">
<option value="orange" <?php if (get_option('color') == "orange") echo 'selected="selected"'; ?> >orange</option>
<option value="green" <?php if (get_option('color') == "green") echo 'selected="selected"'; ?>>green</option>
<option value="blue" <?php if (get_option('color') == "blue") echo 'selected="selected"'; ?>>blue</option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">Background Image</th>
<td>
<input type="file" name="image" />
</td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
}