Esempio n. 1
0
 public static function set_default_settings()
 {
     // Set default configs
     $settings = array('enabled' => array('label' => __('Enabled', 'twitter-tools'), 'label_first' => false, 'value' => 0, 'type' => 'int'), 'create_posts' => array('label' => __('Create posts for each tweet?', 'twitter-tools'), 'label_first' => false, 'value' => 0, 'type' => 'int'), 'post_author' => array('label' => __('Post Author', 'twitter-tools'), 'label_first' => true, 'value' => 0, 'type' => 'int'), 'post_category' => array('label' => __('Post Category', 'twitter-tools'), 'label_first' => true, 'value' => 0, 'type' => 'is_cat'), 'post_tags' => array('label' => __('Post Tags', 'twitter-tools'), 'label_first' => true, 'value' => '', 'type' => 'tags'), 'exclude_reply_tweets' => array('label' => __('Exclude reply tweets from post creation', 'twitter-tools'), 'label_first' => false, 'value' => 1, 'type' => 'int'), 'exclude_retweets' => array('label' => __('Exclude re-tweets from post creation', 'twitter-tools'), 'label_first' => false, 'value' => 1, 'type' => 'int'), 'blog_post_title' => array('label' => __('Blog Post Title Prefix', 'twitter-tools'), 'label_first' => true, 'value' => '', 'type' => 'no_html'));
     AKTT_Account::$settings = apply_filters('aktt_account_default_settings', $settings);
 }
Esempio n. 2
0
 /**
  * Loads the social twitter accounts into a static variable
  *
  * @return void
  */
 static function get_social_accounts()
 {
     $social_twitter = Social::instance()->service('twitter');
     // If we don't have a Social_Twitter object, get out
     if (is_null($social_twitter)) {
         return;
     }
     // If we don't have any Social Twitter accounts, get out
     $social_accounts = $social_twitter->accounts();
     if (empty($social_accounts)) {
         return;
     }
     /* Loop over our social twitter accounts and create AKTT_Account objects 
     		that will store the various configuration options for the twitter accounts. */
     foreach ($social_accounts as $obj_id => $acct_obj) {
         // If this account has already been assigned, continue on
         if (isset(self::$accounts[$obj_id]) || !$acct_obj->universal()) {
             continue;
         }
         /* Call a static method to load the object, so we 
         			can ensure it was instantiated properly */
         $o = AKTT_Account::load($acct_obj);
         // Assign the object, only if we were successfully created
         if (is_a($o, 'AKTT_Account')) {
             self::$accounts[$obj_id] = $o;
         }
     }
 }