Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'release/3.0.1'

  • Loading branch information...
commit 4a5068368de982c235c650c7823346a565e63d2e 2 parents bbbe964 + fae1221
Alex King alexkingorg authored
11 README.txt
View
@@ -3,7 +3,7 @@ Contributors: alexkingorg, crowdfavorite
Tags: twitter, tweet, integration, post, notify, integrate, archive, widget, shortcode, social
Requires at least: 3.4
Tested up to: 3.4.2
-Stable tag: 3.0
+Stable tag: 3.0.1
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -101,7 +101,7 @@ Get creative! Here are some examples of ways to use more of the full Twitter dat
- linking to "in reply to" tweets
-== FAQ ==
+== Frequently Asked Questions ==
= What if I don't want to use Social's comment display? =
@@ -128,6 +128,13 @@ Version 3.0 is a complete rewrite that utilizes <a href="http://wordpress.org/ex
== Changelog ==
+= 3.0.1 =
+
+* Set categories and post tags properly on posts created from tweets
+* Set GMT date explicitly for blog posts created from tweets (fixes time offset issue)
+* Make enabled/disabled accounts more explicit
+
+
= 3.0 =
* Complete rewrite!
4 classes/aktt.php
View
@@ -2,7 +2,7 @@
class AKTT {
// settings: aktt_v3_settings
- static $ver = '3.0dev';
+ static $ver = '3.0.1';
static $enabled = false;
static $prefix = 'aktt_';
static $post_type = 'aktt_tweet';
@@ -110,7 +110,7 @@ static function set_default_settings() {
'label' => __('Create URLs for tweets', 'twitter-tools'),
'type' => 'radio',
'options' => array(
- '1' => sprintf(__('Yes <span class="help">(%s)</span>', 'twitter-tools'), site_url('tweet/{tweet-id}')),
+ '1' => sprintf(__('Yes <span class="help">(%s)</span>', 'twitter-tools'), home_url('tweet/{tweet-id}')),
'0' => __('No', 'twitter-tools')
),
),
18 classes/aktt_tweet.php
View
@@ -470,7 +470,7 @@ function add() {
'post_content' => $this->content(),
'post_status' => 'publish',
'post_type' => AKTT::$post_type,
- 'post_date' => date('Y-m-d H:i:s', self::twdate_to_time($this->date()) + (get_option('gmt_offset') * 3600)),
+ 'post_date_gmt' => date('Y-m-d H:i:s', self::twdate_to_time($this->date())),
'guid' => $this->guid(),
// 'tax_input' => $tax_input, // see below...
));
@@ -546,13 +546,14 @@ function create_blog_post($args = array()) {
'post_title' => $title_prefix.$this->title(),
'post_content' => $post_content,
'post_author' => $post_author,
- 'tax_input' => array(
- 'category' => array($post_category),
- 'post_tag' => array_map('trim', explode(',', $post_tags)),
- ),
+// see below
+// 'tax_input' => array(
+// 'category' => array($post_category),
+// 'post_tag' => array_map('trim', explode(',', $post_tags)),
+// ),
'post_status' => 'publish',
'post_type' => 'post',
- 'post_date' => date('Y-m-d H:i:s', self::twdate_to_time($this->meta['created_at'])),
+ 'post_date_gmt' => date('Y-m-d H:i:s', self::twdate_to_time($this->meta['created_at'])),
'guid' => $this->guid().'-post'
);
$data = apply_filters('aktt_tweet_create_blog_post_data', $data);
@@ -563,6 +564,11 @@ function create_blog_post($args = array()) {
AKTT::log('WP_Error:: '.$this->blog_post_id->get_error_message());
return false;
}
+
+ // have to set up taxonomies after the insert in case we are in a context without
+ // a 'current user' - see: http://core.trac.wordpress.org/ticket/19373
+ wp_set_object_terms($this->blog_post_id, intval($post_category), 'category');
+ wp_set_object_terms($this->blog_post_id, array_map('trim', explode(',', $post_tags)), 'post_tag');
set_post_format($this->blog_post_id, 'status');
2  twitter-tools.php
View
@@ -3,7 +3,7 @@
Plugin Name: Twitter Tools
Plugin URI: http://crowdfavorite.com/wordpress/plugins/twitter-tools/
Description: An integration between your WordPress site and Twitter. Create posts from your tweets. Show your tweets in your sidebar. Relies on <a href="http://wordpress.org/extend/plugins/social/">Social</a>.
-Version: 3.0
+Version: 3.0.1
Author: Crowd Favorite
Author URI: http://crowdfavorite.com
*/
2  upgrade/3.0.php
View
@@ -160,7 +160,7 @@ function(response) {
echo aktt_upgrade_30_shell(__('Twitter Tools Upgrade', 'twitter-tools'), $body, $head, $foot);
}
-function aktt_upgrade_30_run($count = 10) {
+function aktt_upgrade_30_run($count = 25) {
global $wpdb;
// pull next tweet(s)
$count = intval($count);
2  views/admin-account.php
View
@@ -4,7 +4,7 @@
?>
<div class="aktt-account">
- <h3 style="background: url(<?php echo esc_url($account->social_acct->avatar()); ?>) left top no-repeat;"><?php echo esc_html($account->social_acct->name()); ?></h3>
+ <h3 style="background: url(<?php echo esc_url($account->social_acct->avatar()); ?>) left top no-repeat;"><?php echo esc_html($account->social_acct->name()); ?> <span class="aktt-account-disabled-notice"><?php _e('(disabled)', 'twitter-tools'); ?></span></h3>
<div class="settings">
<p>
<label for="<?php echo esc_attr(sprintf($name, 'enabled')); ?>">
31 views/admin.php
View
@@ -38,8 +38,7 @@
margin: 0;
padding: 0;
}
-.aktt-account-enabled {
- background: url(<?php echo esc_url(admin_url('images/yes.png')); ?>) right center no-repeat;
+.aktt-account-enabled.aktt-account-collapsed {
color: #333;
opacity: 1;
}
@@ -50,6 +49,12 @@
margin: 0;
padding: 0 0 0 58px;
}
+.aktt-account-disabled-notice {
+ color: #999;
+}
+.aktt-account-enabled .aktt-account-disabled-notice {
+ display: none;
+}
.aktt-none .aktt-account h3 {
cursor: default;
}
@@ -200,13 +205,11 @@ function akttSetState(elem) {
var $enabled = $account.find('input.enabled');
var $createPosts = $account.find('input.create-posts');
// toggle enabled icon
- if (!$settings.is(':visible')) {
- if ($enabled.is(':checked')) {
- $account.addClass('aktt-account-enabled');
- }
- else {
- $account.addClass('dim');
- }
+ if ($enabled.is(':checked')) {
+ $account.addClass('aktt-account-enabled');
+ }
+ else {
+ $account.removeClass('aktt-account-enabled');
}
// toggle enabled/dimmed for enabled dependent fields
if ($enabled.is(':checked')) {
@@ -229,18 +232,10 @@ function akttSetState(elem) {
var $account = $(this);
akttSetState($account);
$account.find('h3').click(function() {
- $account.removeClass('dim aktt-account-enabled').find('.settings').slideToggle(function() {
+ $account.find('.settings').slideToggle(function() {
akttSetState($account);
});
}).end().find('input[type="checkbox"].enabled, input[type="checkbox"].create-posts').change(function() {
-// if ($(this).filter('.create-posts').size()) {
-// if ($(this).is(':checked')) {
-// $account.find('.depends-on-create-posts').slideDown();
-// }
-// else {
-// $account.find('.depends-on-create-posts').slideUp();
-// }
-// }
akttSetState($account);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.