diff --git a/freifunkmeta.php b/freifunkmeta.php
index 0be2974..528d903 100644
--- a/freifunkmeta.php
+++ b/freifunkmeta.php
@@ -132,6 +132,13 @@ function ff_meta_admin_init() {
'ff_meta_section_one_callback', // callback to fill
'ff_meta_plugin' // page to display on
);
+ add_settings_field(
+ 'ff_meta_dir', // ID
+ 'URL of directory.json', // Title
+ 'ff_meta_dir_callback', // callback to fill field
+ 'ff_meta_plugin', // menu page=slug to display field on
+ 'ff_meta_section-one' // section to display the field in
+ );
add_settings_field(
'ff_meta_url', // ID
'URL of meta.json', // Title
@@ -145,9 +152,20 @@ function ff_meta_section_one_callback() {
echo 'This Plugin provides shortcodes to display information from the Freifunk meta.json.';
}
+function ff_meta_dir_callback() {
+ $url = get_option( 'ff_meta_dir' );
+ if (empty($url)) {
+ $url = "https://raw.githubusercontent.com/freifunk/directory.api.freifunk.net/master/directory.json";
+ }
+ echo "";
+}
+
function ff_meta_url_callback() {
$url = get_option( 'ff_meta_url' );
- echo "";
+ if (empty($url)) {
+ $url = "http://meta.hamburg.freifunk.net/ffhh.json";
+ }
+ echo "";
}
function ff_meta_options_page() {