Twitter Tools integrates with Twitter by giving you the following functionality:
There are a number of configuration options for Twitter Tools. You can find these in Options > Twitter Tools.
If you are using widgets, you can drag Twitter Tools to your sidebar to display your latest tweets.
If you are not using widgest, you can use a template tag to add your latest tweets to your sidebar.
<?php aktt_sidebar_tweets(); ?>
If you just want your latest tweet, use this template tag.
<?php aktt_latest_tweet(); ?>
Twitter Tools contains a hook that can be used to pass along your tweet data to another service (for example, some folks have wanted to be able to update their Facebook status). To use this hook, create a plugin and add an action to:
aktt_add_tweet (action)
Your plugin function will receive an aktt_tweet object as the first parameter.
Example psuedo-code:
function my_status_update($tweet) { // do something here }
add_action('aktt_add_tweet', 'my_status_update')
Twitter Tools also provides a filter on the URL sent to Twitter so that you can run it through an URL-shortening service if you like.
tweet_blog_post_url (filter)
Your plugin function will receive the URL as the first parameter.
Example psuedo-code:
function my_short_url($long_url) {
// do something here - return the shortened URL
$short_url = my_short_url_func($long_url);
return $short_url;
}
add_filter('tweet_blog_post_url', 'my_short_url')
aktt_do_tweet (filter)
Returning false in this hook will prevent a tweet from being sent. One parameter is sent, the Tweet object to be sent to Twitter.
Example psuedo-code:
function dont_tweet($tweet) {
if (some condition) {
// will not tweet
return false;
}
else {
// must return the $tweet to send it
return $tweet;
}
}
add_filter('aktt_do_tweet', 'dont_tweet')
aktt_do_blog_post_tweet (filter)
Returning false in this hook will prevent a blog post Tweet from being sent. Two parameters are passed, the Tweet object to be sent to Twitter and the Post generating the Tweet.
Example psuedo-code:
function dont_post_tweet($tweet, $post) {
if (some condition) {
// will not tweet
return false;
}
else {
// must return the $tweet to send it
return $tweet;
}
}
add_filter('aktt_do_blog_post_tweet', 'dont_post_tweet', 10, 2)
aktt_do_tweet_post (filter)
Returning false in this hook will prevent a blog post from being created from a Tweet. Two parameters are passed, the data to be used in the post and the Tweet object.
Example psuedo-code:
function dont_tweet_post($post, $data) {
if (some condition) {
// will not post
return false;
}
else {
// must return the $data for a post to be created
return $data;
}
}
add_filter('aktt_do_tweet_post', 'dont_tweet_post', 10, 2)
aktt_tweets_to_digest_post (filter)
Allows you to make changes the tweets that will be included in a digest post.
aktt_options_form (action)
Allows you to add to the Twitter Tools settings page.
aktt_post_options (action)
Allows you to add to the Twitter Tools box on the New Post page (requires the option to tweet on blog posts to be enabled).




