'', 'version' => '1', 'twitter_handle' => '@TheFrosty', 'author' => true, /* Simple */ 'linkifyusers' => false, 'hovercards' => false, /* Tweetbox */ 'tweetbox' => false, 'tweetbox_placement' => 'after', 'tweetbox_content' => '', 'tweetbox_label' => '', 'use_tweetbox_content' => false, 'tweetbox_content' => 'Reading [anywhere-title] [anywhere-link] /via [twitter-handle]', 'tweetbox_height' => '50px', 'tweetbox_width' => '450px', /* wpAd */ 'hide_ad' => false, ); return $settings_arr; } /** * Handles the main plugin settings * * @since 0.3 */ function anywhere_page() { /* * 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 '
'; if ( function_exists('screen_icon') ) screen_icon(); echo '

' . $settings_page_title . '

'; echo '
'; echo '

Don′t you feel good. You just saved me!

'; echo '
'; elseif ( $_POST[$hidden_field_name] == 'R') : foreach($settings_arr as $key => $value) : $settings[$key] = $val[$key] = $_POST[$data[$key]]; endforeach; delete_option( 'anywhere_settings', $settings ); /* * Output the settings page */ echo '
'; if ( function_exists('screen_icon') ) screen_icon(); echo '

' . $settings_page_title . '

'; echo '
'; echo '

Oh no! I′ve been reset.

'; echo '
'; else : echo '
'; if ( function_exists('screen_icon') ) screen_icon(); echo '

' . $settings_page_title . '

'; endif; ?>

>