| 1 |
<?php |
| 2 |
/** |
| 3 |
* Twitter block template |
| 4 |
* |
| 5 |
* @var $attributes - block attributes |
| 6 |
* @var $options - layout options |
| 7 |
* |
| 8 |
* @link https://codesupply.co |
| 9 |
* @since 1.0.0 |
| 10 |
* |
| 11 |
* @package PowerKit |
| 12 |
* @subpackage PowerKit/templates |
| 13 |
*/ |
| 14 |
|
| 15 |
$params = array( |
| 16 |
'title' => esc_html__( 'Twitter Feed', 'powerkit' ), |
| 17 |
'username' => $attributes['username'], |
| 18 |
'number' => $attributes['number'], |
| 19 |
'header' => $attributes['showHeader'], |
| 20 |
'button' => $attributes['showFollowButton'], |
| 21 |
'replies' => $attributes['showReplies'], |
| 22 |
'retweets' => $attributes['showRetweets'], |
| 23 |
'template' => 'default', |
| 24 |
'is_block' => true, |
| 25 |
'block_attrs' => $attributes, |
| 26 |
); |
| 27 |
|
| 28 |
echo '<div class="' . esc_attr( $attributes['className'] ) . '" ' . ( isset( $attributes['anchor'] ) ? ' id="' . esc_attr( $attributes['anchor'] ) . '"' : '' ) . '>'; |
| 29 |
|
| 30 |
// Instagram output. |
| 31 |
if ( $attributes['username'] ) { |
| 32 |
powerkit_twitter_get_recent( $params, 'powerkit_twitter_block_cache' ); |
| 33 |
} else { |
| 34 |
powerkit_alert_warning( 'Twitter data is not set, please check the User Name.' ); |
| 35 |
} |
| 36 |
|
| 37 |
echo '</div>'; |
| 38 |
|