simple location plugin dev

This commit is contained in:
Dan Ballard 2014-01-02 09:41:00 -05:00
commit b2f65fa12d
2 changed files with 46 additions and 0 deletions

17
options.php Normal file
View File

@ -0,0 +1,17 @@
<div class="wrap"
<?php screen_icon(); ?>
<h2>Simple Location Options</h2>
<form method="post" action="options.php">
<?php
settings_fields( 'simple-location-options' );
?>
Google API Key: <input id="gapi-key" name="gapi-key" type="text" value="<?php print get_option('gapi-key'); ?>" />
<?php submit_button(); ?>
</form>
</div>

29
simple-location.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/*
Plugin Name: Simple Location
Plugin URI: http://www.danballard.com/
Description: Auto tags posts with city, country info
Version: 0.1
Author: Dan Ballard
Author URI: http://www.danballard.com
Minimum WordPress Version Required: 3.8
Tested up to: 3.8
*/
if ( is_admin() ) {
add_action( 'admin_menu', 'add_options_menu' );
add_action( 'admin_init', 'reg_settings' );
}
function add_options_menu() {
add_options_page('Simple Location Options', 'Simple Location', 'manage_options', 'simple-location', 'options_page');
}
function options_page() {
include( plugin_dir_path(__FILE__) . 'options.php');
}
function reg_settings() {
register_setting( 'simple-location-options', 'gapi-key' );
}