setKey($key); $locations = $ipLite->getCity($_SERVER['REMOTE_ADDR']); print 'locations: '; print_r($locations); } if ($_POST['city'] == '') { $_POST['city'] = $locations['cityName']; } update_post_meta($post_id, '_simple_location_city', sanitize_text_field($_POST['city'])); if ($_POST['country'] == '') { $_POST['country'] = $locations['countryName']; } update_post_meta($post_id, '_simple_location_country', sanitize_text_field($_POST['country'])); } function simple_location_meta() { include( plugin_dir_path(__FILE__) . 'post-form.php'); } function options_page() { include( plugin_dir_path(__FILE__) . 'options.php'); } function reg_settings() { register_setting( 'simple-location-options', 'simple-location-api-key' ); }