Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.