コード例 #1
0
function register_my_twitter_feed_shortcode($given_atts)
{
    /* Default values here will always be NULL, defaults
       are checked and set in the plugin itself */
    $default_atts = array('feed_type' => NULL, 'user' => NULL, 'search_term' => NULL, 'list' => NULL, 'count' => NULL, 'exclude_replies' => NULL, 'exclude_retweets' => NULL, 'relative_times' => NULL, 'show_images' => NULL, 'https' => NULL, 'default_styling' => NULL, 'cache_hours' => NULL, 'clear_cache' => NULL, 'oauth_access_token' => NULL, 'oauth_access_token_secret' => NULL, 'consumer_key' => NULL, 'consumer_secret' => NULL);
    extract(shortcode_atts($default_atts, $given_atts));
    $feed_config = array('feed_type' => $feed_type, 'user' => $user, 'search_term' => $search_term, 'list' => $list, 'count' => $count, 'exclude_replies' => $exclude_replies, 'exclude_retweets' => $exclude_retweets, 'relative_times' => $relative_times, 'show_images' => $show_images, 'https' => $https, 'default_styling' => $default_styling, 'cache_hours' => $cache_hours, 'clear_cache' => $clear_cache, 'oauth_access_token' => $oauth_access_token, 'oauth_access_token_secret' => $oauth_access_token_secret, 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'is_shortcode_called' => TRUE);
    /* If you've created your own template tag, change the
       tag here to match it. Otherwise, leave it as is */
    return db_twitter_feed($feed_config);
}
コード例 #2
0
			<div class="col_2">
				
				<?php 
get_sidebar('footer-three');
?>
				
			</div>
			
			<div class="col_2 widget-area">
				
				<div class="widget" style="padding-top: 7px; margin: 0 10px;">
				
				<h3>Twitter</h3>
				
				<div id="twitterfeed"><?php 
db_twitter_feed();
?>
</div>
				<div id="twittermessage"><p>If you can’t see the Twitter Feed, its because your browser doesn't support it.</p></div>
				
				</div>
				
			</div>
			
			<div class="col_2 last">
				
				<?php 
get_sidebar('footer-five');
?>
				
			</div>
コード例 #3
0
 /**
  * Register the shortcode that is used to render the feed
  *
  * This method is merely a port that moves the configuration data given
  * to the db_twitter_feed() template tag, which does all of the actual
  * work.
  *
  * @access public
  * @return string The db_twitter_feed() template tag with the $given_atts array as the parameter
  * @since 1.0.0
  *
  * @param array $given_atts An associative array of feed configuration options
  */
 public function register_twitter_feed_sc($given_atts)
 {
     $default_atts = array('feed_type' => NULL, 'user' => NULL, 'search_term' => NULL, 'list' => NULL, 'count' => NULL, 'exclude_replies' => NULL, 'exclude_retweets' => NULL, 'relative_times' => NULL, 'show_images' => NULL, 'https' => NULL, 'default_styling' => NULL, 'cache_hours' => NULL, 'clear_cache' => NULL, 'oauth_access_token' => NULL, 'oauth_access_token_secret' => NULL, 'consumer_key' => NULL, 'consumer_secret' => NULL);
     extract(shortcode_atts($default_atts, $given_atts));
     $feed_config = array('feed_type' => $feed_type, 'user' => $user, 'search_term' => $search_term, 'list' => $list, 'count' => $count, 'exclude_replies' => $exclude_replies, 'exclude_retweets' => $exclude_retweets, 'relative_times' => $relative_times, 'show_images' => $show_images, 'https' => $https, 'default_styling' => $default_styling, 'cache_hours' => $cache_hours, 'clear_cache' => $clear_cache, 'oauth_access_token' => $oauth_access_token, 'oauth_access_token_secret' => $oauth_access_token_secret, 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'is_shortcode_called' => TRUE);
     return db_twitter_feed($feed_config);
 }