Created
May 25, 2012 16:04
-
-
Save thomasgriffin/2788954 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Store oEmbed results in a transient */ | |
if ( false === ( $tweets = get_site_transient( 'tgm_get_tweets' ) ) { | |
$tweets = wp_oembed_get( $url, $args ); | |
if ( ! $tweets ) // wp_oembed_get returns false on failure | |
$tweets = *get your old tweets from here*; | |
set_site_transient( 'tgm_get_tweets', $tweets, 60*60*24 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment