/**
  * Reprocess Comments Box settings to verify saved data
  *
  * @since 1.1.6
  */
 public static function comments_settings()
 {
     if (!class_exists('Facebook_Comments_Settings')) {
         require_once dirname(__FILE__) . '/settings-comments.php';
     }
     $comments_options = get_option(Facebook_Comments_Settings::OPTION_NAME);
     if (!is_array($comments_options)) {
         $comments_options = array();
     }
     $comments_options['show_on'] = array_keys(Facebook_Comments_Settings::get_display_conditionals_by_feature('comments', 'posts'));
     update_option(Facebook_Comments_Settings::OPTION_NAME, Facebook_Comments_Settings::sanitize_options($comments_options));
 }
Exemplo n.º 2
0
 /**
  * Migrate comments-specific settings
  *
  * @since 1.1
  * @param array $options existing settings
  * @return result of update_option, if run
  */
 public static function migrate_comments($options)
 {
     if (!is_array($options) || empty($options)) {
         return;
     }
     $options = self::show_on($options);
     // pass comments settings through same sanitizer as individual settings page
     if (!class_exists('Facebook_Comments_Settings')) {
         require_once dirname(__FILE__) . '/settings-comments.php';
     }
     $options = Facebook_Comments_Settings::sanitize_options($options);
     if (!empty($options)) {
         return update_option(Facebook_Comments_Settings::OPTION_NAME, $options);
     }
 }