diff --git a/classes/aktt.php b/classes/aktt.php index 8569825..2e628ce 100644 --- a/classes/aktt.php +++ b/classes/aktt.php @@ -25,7 +25,7 @@ class AKTT { static function init() { self::$enabled = class_exists('Social'); if (!self::$enabled) { - self::add_admin_notice('error', sprintf(__('Twitter Tools relies on the Social plugin, please install this plugin.', 'twitter-tools'), 'http://wordpress.org/extend/plugins/social/')); + self::add_admin_notice(sprintf(__('Twitter Tools relies on the Social plugin, please install this plugin.', 'twitter-tools'), 'http://wordpress.org/extend/plugins/social/'), 'error'); return; } @@ -77,8 +77,8 @@ static function set_default_settings() { '0' => __('No', 'twitter-tools') ); self::$settings = array( - 'enable_admin_ui' => array( - 'name' => 'enable_admin_ui', + 'tweet_admin_ui' => array( + 'name' => 'tweet_admin_ui', 'value' => 1, 'label' => __('Show admin screens for tweets', 'twitter-tools'), 'type' => 'radio', @@ -118,11 +118,11 @@ static function set_default_settings() { /** * Append a message of a certain type to the admin notices. * - * @param string $type * @param string $msg + * @param string $type * @return void */ - static function add_admin_notice($type, $msg) { + static function add_admin_notice($msg, $type = 'updated') { self::$admin_notices[] = array( 'type' => $type == 'error' ? $type : 'updated', // If it's not an error, set it to updated 'msg' => $msg @@ -164,7 +164,7 @@ static function register_post_type() { 'editor', ), 'public' => (bool) self::option('tweet_visibility'), - 'show_ui' => (bool) self::option('enable_admin_ui'), + 'show_ui' => (bool) self::option('tweet_admin_ui'), 'rewrite' => array( 'slug' => 'tweets', 'with_front' => false @@ -379,9 +379,6 @@ static function the_post($post) { if ($raw_data = get_post_meta($post->ID, '_aktt_tweet_raw_data', true)) { $post->tweet = new AKTT_Tweet(json_decode($raw_data)); } - else { - $post->tweet = new AKTT_Tweet(false); - } } return $post; } @@ -919,7 +916,7 @@ function admin_controller(){ self::import_tweets(); wp_redirect(add_query_arg(array( 'page' => self::$menu_page_slug, - 'tweets_updated' => '1'), + 'aktt_action' => 'tweets_updated'), admin_url('options-general.php') )); break; @@ -951,6 +948,9 @@ function admin_controller(){ )); die(); break; + case 'tweets_updated': + self::add_admin_notice(__('Tweets are downloading...', 'twitter-tools')); + break; } } } diff --git a/classes/aktt_tweet.php b/classes/aktt_tweet.php index a85fcaf..4c61c53 100644 --- a/classes/aktt_tweet.php +++ b/classes/aktt_tweet.php @@ -332,7 +332,6 @@ function link_entities() { ); } ksort($entities); - $str = $this->content(); $diff = 0; foreach ($entities as $entity) { diff --git a/views/admin.php b/views/admin.php index 579112a..582f530 100644 --- a/views/admin.php +++ b/views/admin.php @@ -84,7 +84,7 @@

diff --git a/views/tweet.php b/views/tweet.php index 617a39b..712c807 100644 --- a/views/tweet.php +++ b/views/tweet.php @@ -7,10 +7,14 @@ echo wptexturize($content); -if (isset($tweet->tweet) && $tweet->tweet->is_reply()) { +if (isset($tweet->tweet)) { + if ($tweet->tweet->is_reply()) { ?> tweet->reply_screen_name())); ?> post_date_gmt))); ?> +