remove user configurable ff_meta_dir option

This commit is contained in:
Martin Schuette 2014-04-03 22:39:45 +00:00
parent a3a0462a95
commit 15005fb702

View file

@ -48,7 +48,7 @@ function ff_meta_shortcode_handler( $atts, $content, $name ) {
// check for city name // check for city name
if (!empty($atts[0])) { if (!empty($atts[0])) {
$city = $atts[0]; $city = $atts[0];
if (false === ($directory = ff_meta_getmetadata (get_option( 'ff_meta_dir', FF_META_DEFAULT_DIR ))) if (false === ($directory = ff_meta_getmetadata ( FF_META_DEFAULT_DIR ))
|| empty($directory[$city])) { || empty($directory[$city])) {
return ''; return '';
} }
@ -146,10 +146,6 @@ function ff_meta_admin_init() {
'ff_meta_settings-group', // group name 'ff_meta_settings-group', // group name
'ff_meta_url' // option name 'ff_meta_url' // option name
); );
register_setting(
'ff_meta_settings-group', // group name
'ff_meta_dir' // option name
);
add_settings_section( add_settings_section(
'ff_meta_section-one', // ID 'ff_meta_section-one', // ID
'Section One', // Title 'Section One', // Title
@ -172,14 +168,6 @@ function ff_meta_admin_init() {
'ff_meta_section-one', // section to display the field in 'ff_meta_section-one', // section to display the field in
array('label_for' => 'ff_meta_url_id') // ID of input element array('label_for' => 'ff_meta_url_id') // ID of input element
); );
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
array('label_for' => 'ff_meta_dir_id') // ID of input element
);
} }
function ff_meta_section_one_callback() { function ff_meta_section_one_callback() {
@ -192,12 +180,6 @@ function ff_meta_cachetime_callback() {
."<p class='description'>Data from external URLs is cached for this number of minutes.</p>"; ."<p class='description'>Data from external URLs is cached for this number of minutes.</p>";
} }
function ff_meta_dir_callback() {
$url = get_option( 'ff_meta_dir', FF_META_DEFAULT_DIR );
echo "<input type='text' name='ff_meta_dir' id='ff_meta_dir_id' class='large-text code' value='$url' />"
."<p class='description'>Please keep the default unless you really know what you are doing.</p>";
}
function ff_meta_url_callback() { function ff_meta_url_callback() {
$url = get_option( 'ff_meta_url', FF_META_DEFAULT_URL ); $url = get_option( 'ff_meta_url', FF_META_DEFAULT_URL );
echo "<input type='text' name='ff_meta_url' id='ff_meta_url_id' class='large-text code' value='$url' />" echo "<input type='text' name='ff_meta_url' id='ff_meta_url_id' class='large-text code' value='$url' />"