Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Last active December 19, 2015 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokamoto/5931674 to your computer and use it in GitHub Desktop.
Save wokamoto/5931674 to your computer and use it in GitHub Desktop.
<?php
add_action('StaticPress::options_page', 'static_press_options_page');
function static_press_options_page(){
$access_key = get_option('static_press_access_key');
$secret_key = get_option('static_press_secret_key');
$s3_bucket = get_option('static_press_s3_bucket');
?>
<div class="wrap">
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="">
<?php echo wp_nonce_field('nonce_action', 'nonce_name', true, false) . "\n"; ?>
<table class="wp-list-table fixed"><tbody>
<tr>
<th><label for="access_key">AWS Access Key</label></th>
<td>
<input type="text" name="access_key" value="<?php echo esc_attr($access_key); ?>" id="access_key" size=100 />
</td>
</tr>
<tr>
<th><label for="secret_key">AWS Secret Key</label></th>
<td>
<input type="text" name="secret_key" value="<?php echo esc_attr($secret_key); ?>" id="secret_key" size=100 />
</td>
</tr>
<tr>
<th><label for="region">AWS Region</label></th>
<td><select name="region">
<option value=""></option>
<option value="US_EAST_1">US_EAST_1</option>
<option value="US_WEST_1">US_WEST_1</option>
<option value="US_WEST_2">US_WEST_2</option>
<option value="EU_WEST_1">EU_WEST_1</option>
<option value="AP_SOUTHEAST_1">AP_SOUTHEAST_1</option>
<option value="AP_SOUTHEAST_2">AP_SOUTHEAST_2</option>
<option value="AP_NORTHEAST_1" selected>AP_NORTHEAST_1</option>
<option value="SA_EAST_1">SA_EAST_1</option>
<option value="US_GOV_WEST_1">US_GOV_WEST_1</option>
</select>
</td>
</tr>
<tr>
<th><label for="s3_bucket">S3 Bucket</label></th>
<td>
<input type="text" name="s3_bucket" value="<?php echo esc_attr($s3_bucket); ?>" id="s3_bucket" size=100 />
</td>
</tr>
</tbody></table>
<?php submit_button(); ?>
</form>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment