Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Replace post content with tweet URL using Twitter Tools data.
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