PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_webnus_twitterfeed ( $atts, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'username' => '', 'count' => '1', 'access_token' => '', 'access_token_secret' => '', 'consumer_key' => '', 'consumer_secret' => '', 'background_image' => '', 'shortcodeclass' => '', 'shortcodeid' => '', ), $atts)); ob_start(); $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; ?> <section class="wn-wrap-tweets-carousel <?php echo '' . $shortcodeclass; ?>" <?php echo $shortcodeid; ?>> <div class="wn-tweets-carousel"> <i class="wn-fab wn-fa-twitter colorf"></i> <?php require_once dirname( __FILE__ ) . '/classes/twitter-api.php'; /** Set access tokens here - see: https://dev.twitter.com/apps/ **/ $settings = array( 'oauth_access_token' => $access_token, 'oauth_access_token_secret' => $access_token_secret, 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret ); $url = "https://api.twitter.com/1.1/statuses/user_timeline.json"; $requestMethod = "GET"; $getfield = "?screen_name=$username&count=$count"; $twitter = new TwitterAPIExchange($settings); $tweets = json_decode($twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest(),$assoc = TRUE); if( isset( $tweets['errors'][0]['message'] ) && $tweets['errors'][0]['message'] != '' ) : echo ' <h3>' . esc_html__( 'Sorry, there was a problem.', 'deep' ) . '</h3> <p>' . esc_html__( 'Twitter returned the following error message:', 'deep' ) . '</p> <p><em>' . $tweets['errors'][0]['message'] . '</em></p>'; else : if ( $count > 1 ) { echo '<div class="tweets-owl-carousel owl-carousel owl-theme">'; } if ( isset( $tweets ) ) { foreach( $tweets as $tweet ) : // Convert attags to twitter profiles in <a> links $tweet['text'] = preg_replace("/@([A-Za-z0-9\/\.]*)/", "<a href=\"http://www.twitter.com/$1\">@$1</a>", $tweet['text']); // Formatting Twitter’s Date/Time $tweet['created_at'] = date("l M j \- g:ia",strtotime($tweet['created_at'])); echo '<p>' . $tweet['text'] . '</p>'; endforeach; } if ( $count > 1 ) { echo '</div>'; } deep_call_template( 'social.php' ); endif; ?> </div> </section> <?php $out = ob_get_contents(); ob_end_clean(); $out = str_replace('<p></p>','',$out); return $out; } add_shortcode( 'twitterfeed', 'deep_webnus_twitterfeed' );
[+]
..
[-] video-teaser.php
[edit]
[-] vcw.php
[edit]
[-] sermon-category.php
[edit]
[-] iconbox.php
[edit]
[-] speakers.php
[edit]
[-] iconfonts-param.php
[edit]
[-] checklist-param.php
[edit]
[-] infobox.php
[edit]
[-] webtags.php
[edit]
[-] teaser-box.php
[edit]
[-] latest-from-blog.php
[edit]
[-] reservation.php
[edit]
[-] subscribe.php
[edit]
[-] progressbar.php
[edit]
[-] review-items.php
[edit]
[-] icon-divider.php
[edit]
[-] toggle-box.php
[edit]
[+]
assets
[-] pie.php
[edit]
[-] asermon.php
[edit]
[-] buttons.php
[edit]
[-] accordion.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] deep-gallery.php
[edit]
[-] custom-menu.php
[edit]
[-] postslider.php
[edit]
[-] magazine.php
[edit]
[-] callout.php
[edit]
[-] maxcounter.php
[edit]
[-] testimonialslider.php
[edit]
[-] testimonials.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] services.php
[edit]
[-] image-carousel.php
[edit]
[-] category-tab.php
[edit]
[-] slide-up-note.php
[edit]
[-] ourteam.php
[edit]
[-] prayerwall-items.php
[edit]
[-] heading.php
[edit]
[-] tablepress.php
[edit]
[-] instagram.php
[edit]
[-] video-play.php
[edit]
[-] columns.php
[edit]
[-] special-offer.php
[edit]
[-] like-view-share.php
[edit]
[-] image-hotspot.php
[edit]
[-] postfromblog.php
[edit]
[-] roadmap.php
[edit]
[-] search.php
[edit]
[-] recipes.php
[edit]
[-] ourclients.php
[edit]
[-] tab.php
[edit]
[-] blog.php
[edit]
[-] icon.php
[edit]
[-] latest-tweets.php
[edit]
[-] before-after-image.php
[edit]
[-] food-menu.php
[edit]
[-] alerts.php
[edit]
[-] login.php
[edit]
[-] pricing-plan.php
[edit]
[-] dropcap.php
[edit]
[-] rooms.php
[edit]
[-] prayerwall-form.php
[edit]
[-] countdown.php
[edit]
[-] lefttab.php
[edit]
[-] schedule.php
[edit]
[-] block-quote.php
[edit]
[-] highlight.php
[edit]
[-] our-process.php
[edit]
[-] w-title.php
[edit]
[-] shop-products.php
[edit]
[-] buy-process.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] causes.php
[edit]
[-] review-form.php
[edit]
[-] pricingtables.php
[edit]
[-] sermons.php
[edit]
[-] distance.php
[edit]
[-] collection.php
[edit]
[-] donate.php
[edit]
[-] googlemap.php
[edit]
[-] list.php
[edit]
[-] acause.php
[edit]
[-] service-carousel.php
[edit]
[-] quote.php
[edit]
[-] w-svg.php
[edit]
[-] tooltip.php
[edit]
[-] socials.php
[edit]
[-] process-carousel.php
[edit]