actions.php
1 month ago
author.php
1 month ago
error.php
1 month ago
feed.php
1 month ago
footer.php
1 month ago
header-generic.php
1 month ago
header-text.php
1 month ago
header.php
1 month ago
item.php
1 month ago
linkbox.php
1 month ago
actions.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Smash Balloon Custom Twitter Feeds Link Box Template |
| 4 | * Information about the person tweeting, replying, or quoting |
| 5 | * |
| 6 | * @version 2.0.4 Custom Twitter Feeds by Smash Balloon |
| 7 | * |
| 8 | */ |
| 9 | use TwitterFeed\CTF_Parse; |
| 10 | use TwitterFeed\CTF_Display_Elements; |
| 11 | |
| 12 | $post_id = CTF_Parse::get_post_id( $post ); |
| 13 | $author_screen_name = CTF_Parse::get_author_screen_name( $post ); |
| 14 | $retweet_count = CTF_Parse::get_retweet_count( $post ) > 0 ? CTF_Parse::get_retweet_count( $post ) : ''; |
| 15 | $favorite_count = CTF_Parse::get_favorite_count( $post ) > 0 ? CTF_Parse::get_favorite_count( $post ) : ''; |
| 16 | $actions_attr = CTF_Display_Elements::get_element_attribute( 'actions', $feed_options ); |
| 17 | $viewtwitterlink_attr = CTF_Display_Elements::get_element_attribute( 'viewtwitterlink', $feed_options ); |
| 18 | $viewtwitterlink_text_attr = CTF_Display_Elements::get_element_attribute( 'viewtwitterlink_text', $feed_options ); |
| 19 | $display_action_links = CTF_Display_Elements::display_action_links( $feed_options ); |
| 20 | $tweet_action_end_url = $post_id . '&related=' . $author_screen_name; |
| 21 | ?> |
| 22 | |
| 23 | <?php if ( $display_action_links ) : ?> |
| 24 | <div class="ctf-tweet-actions" <?php echo $actions_attr; ?>> |
| 25 | <?php if ( ctf_show( 'actions', $feed_options ) ) : ?> |
| 26 | |
| 27 | <a href="<?php echo esc_url( 'https://twitter.com/intent/tweet?in_reply_to=' . $tweet_action_end_url ) ?>" class="ctf-reply" target="_blank" rel="noopener noreferrer"> |
| 28 | <?php echo ctf_get_fa_el( 'fa-reply' ) ?> |
| 29 | <span class="ctf-screenreader"><?php _e( 'Reply on Twitter', 'custom-twitter-feeds' ); ?> <?php echo esc_html( $post_id ); ?></span> |
| 30 | </a> |
| 31 | |
| 32 | <a href="<?php echo esc_url( 'https://twitter.com/intent/retweet?tweet_id=' . $tweet_action_end_url ) ?>" class="ctf-retweet" target="_blank" rel="noopener noreferrer"><?php echo ctf_get_fa_el( 'fa-retweet' ) ?> |
| 33 | <span class="ctf-screenreader"><?php _e( 'Retweet on Twitter', 'custom-twitter-feeds' ); ?> <?php echo esc_html( $post_id ); ?></span> |
| 34 | <span class="ctf-action-count ctf-retweet-count"><?php echo $retweet_count; ?></span> |
| 35 | </a> |
| 36 | |
| 37 | <a href="<?php echo esc_url( 'https://twitter.com/intent/like?tweet_id=' . $tweet_action_end_url ) ?>" class="ctf-like" target="_blank" rel="nofollow noopener noreferrer"> |
| 38 | <?php echo ctf_get_fa_el( 'fa-heart' ) ?> |
| 39 | <span class="ctf-screenreader"><?php _e( 'Like on Twitter', 'custom-twitter-feeds' ); ?> <?php echo esc_html( $post_id ); ?></span> |
| 40 | <span class="ctf-action-count ctf-favorite-count"><?php echo $favorite_count; ?></span> |
| 41 | </a> |
| 42 | <?php endif; ?> |
| 43 | |
| 44 | <?php if (( isset($feed_options['viewtwitterlink']) && $feed_options['viewtwitterlink'] == true) || ctf_doing_customizer( $feed_options) ) : ?> |
| 45 | <a href="<?php echo esc_url( 'https://twitter.com/' . $author_screen_name . '/status/' .$post_id ) ?>" class="ctf-twitterlink" target="_blank" rel="nofollow noopener noreferrer" <?php echo $viewtwitterlink_attr ?>> |
| 46 | <span <?php echo $viewtwitterlink_text_attr ?>><?php echo esc_html( $feed_options['twitterlinktext'] ); ?></span> |
| 47 | <span class="ctf-screenreader"><?php echo esc_attr( $post_id ); ?></span> |
| 48 | </a> |
| 49 | <?php endif; ?> |
| 50 | </div> |
| 51 | <?php endif; ?> |
| 52 |