Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created February 9, 2014 22:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkingorg/8907138 to your computer and use it in GitHub Desktop.
Save alexkingorg/8907138 to your computer and use it in GitHub Desktop.
Replace post content with tweet URL using Twitter Tools data.
<?php
function aktt_replace_tweet_content($posts) {
foreach ($posts as $post) {
if ($post->post_type == AKTT::$post_type && !empty($post->tweet)) {
$post->post_content = esc_url(AKTT::status_url($post->tweet->username(), $post->tweet->id()));
}
}
}
add_action('the_posts', 'aktt_replace_tweet_content', 11);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment