/**
  * Add an app access token and an app namespace to existing Facebook application data
  *
  * @since 1.1.6
  */
 public static function app_settings()
 {
     if (!class_exists('Facebook_Application_Settings')) {
         require_once dirname(__FILE__) . '/settings-app.php';
     }
     $app_options = get_option(Facebook_Application_Settings::OPTION_NAME);
     if (is_array($app_options) && isset($app_options['app_id'])) {
         update_option(Facebook_Application_Settings::OPTION_NAME, Facebook_Application_Settings::sanitize_options($app_options));
     }
 }
Beispiel #2
0
 /**
  * migrate options from Facebook plugin 1.0 style to 1.1
  *
  * @since 1.1
  */
 public static function migrate()
 {
     $old_options = get_option('fb_options');
     if (!is_array($old_options) || empty($old_options)) {
         return;
     }
     $app_settings = array();
     foreach (array('app_id', 'app_secret', 'app_namespace') as $option_name) {
         if (isset($old_options[$option_name])) {
             $app_settings[$option_name] = trim($old_options[$option_name]);
         }
     }
     if (!empty($app_settings)) {
         if (!class_exists('Facebook_Application_Settings')) {
             require_once dirname(__FILE__) . '/settings-app.php';
         }
         $app_settings = Facebook_Application_Settings::sanitize_options($app_settings);
         if (!empty($app_settings)) {
             update_option(Facebook_Application_Settings::OPTION_NAME, $app_settings);
         }
     }
     unset($app_settings);
     if (isset($old_options['comments'])) {
         self::migrate_comments($old_options['comments']);
     }
     if (isset($old_options['like'])) {
         self::migrate_like_button($old_options['like']);
     }
     if (isset($old_options['recommendations_bar'])) {
         self::migrate_recommendations_bar($old_options['recommendations_bar']);
     }
     if (isset($old_options['send'])) {
         self::migrate_send_button($old_options['send']);
     }
     if (isset($old_options['social_publisher'])) {
         self::migrate_social_publisher($old_options['social_publisher']);
     }
     if (isset($old_options['follow'])) {
         self::migrate_follow_button($old_options['follow']);
     }
 }