'', 'version' => '1', /* Simple */ 'linkifyusers' => false, 'hovercards' => false, /* Tweetbox */ 'tweetbox' => false, 'tweetbox_content' => '', 'tweetbox_label' => '', 'tweetbox_width' => '450px', ); return $settings_arr; } /** * Handles the main plugin settings * * @since 0.3 */ function anywhere_page() { echo '' . "\n"; /* * Main settings variables */ $plugin_name = 'anywhere'; $settings_page_title = '@anywhere settings'; $hidden_field_name = 'anywhere_submit_hidden'; $plugin_data = get_plugin_data( ANYWHERE . '/anywhere.php'); /* * Grabs the default plugin settings */ $settings_arr = anywhere_settings_args(); /* * Add a new option to the database */ add_option( 'anywhere_settings', $settings_arr ); /* * Set form data IDs the same as settings keys * Loop through each */ $settings_keys = array_keys( $settings_arr ); foreach ( $settings_keys as $key ) : $data[$key] = $key; endforeach; /* * Get existing options from database */ $settings = get_option( 'anywhere_settings' ); foreach ( $settings_arr as $key => $value ) : $val[$key] = $settings[$key]; endforeach; /* * If any information has been posted, we need * to update the options in the database */ if ( $_POST[$hidden_field_name] == 'Y' ) : /* * Loops through each option and sets it if needed */ foreach ( $settings_arr as $key => $value ) : $settings[$key] = $val[$key] = $_POST[$data[$key]]; endforeach; /* * Update plugin settings */ update_option( 'anywhere_settings', $settings ); /* * Output the settings page */ echo '
Don′t you feel good. You just saved me!
'; echo 'Oh no! I′ve been reset.
'; echo '