www.openweathermap.org"; } // ================ Callback Fields ================ public function api_key_callback($arguments) { // This is, where the input field for the api key goes echo ''; printf( ' %s', $this->api_helper ); $api_additional_help = __('Get your API-Key on', 'aiws-weather')." www.openweathermap.org"; printf( '
%s
', $api_additional_help ); } public function units_callback($arguments) { // Fetch existing option: $checked = get_option('aiws_units'); $checked_imperial = ''; $checked_metric = ''; if($checked == 'imperial') { $checked_imperial = "checked"; } if($checked == 'metric') { $checked_metric = "checked"; } // This is, where the input field for the unit goes echo ' '; } public function aiws_display_temperature_symbol_callback($arguments) { // Fetch existing option: $checked = get_option('aiws_display_temperature_symbol'); $checked_yes = ''; $checked_no = ''; if($checked == 'yes') { $checked_yes = "checked"; } if($checked == 'no') { $checked_no = "checked"; } // Radio buttons if you want to display symbols or not echo ' '; } public function aiws_default_city_callback($arguments) { // This is, where the input field for the default city goes echo ''; $additional_help_aiws_default_city = __('This city is used, if you omit the optional parameter "citycode" in your shortcode. Useful for repeating weather data of one specific city throughout the blog.', 'aiws-weather'); printf( ' %s', $this->aiws_default_city_helper ); printf( '%s
', $additional_help_aiws_default_city ); } // ================ Create the settings page ========= // This is, where all the content is put together and the API-Key is checked public function plugin_settings_page_content() { ?>www.openweathermap.org and search for your city. Open the site and have a look at the URL, for example:http://openweathermap.org/city/2857458. The number at the end of the URL is the citycode.', 'aiws-weather'); ?>
[temp] wherever you want to display the current temperature of your default city. Thats all!','aiws-weather'); ?>
[temp citycode="xxxxxxx"] wherever you want, to get the temperature from the city you want.','aiws-weather'); ?>
[tempDay day="x" citycode="xxxxxxx"] shortcode. Both parameters are optional, if you omit day="x", the shortcode will return temperature of the current day. Possible values are 0 - 5.','aiws-weather'); ?>
citycode="xxxxxxx" the default citycode is used.', 'aiws-weather'); ?>