actions.php
3 weeks ago
author.php
3 weeks ago
error.php
3 weeks ago
feed.php
3 weeks ago
footer.php
3 weeks ago
header-generic.php
3 weeks ago
header-text.php
3 weeks ago
header.php
3 weeks ago
item.php
3 weeks ago
linkbox.php
3 weeks ago
header.php
68 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Smash Balloon Custom Twitter Feeds Header 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 | use TwitterFeed\CTF_GDPR_Integrations; |
| 12 | |
| 13 | $header_no_bio = ( !$feed_options['showbio'] || empty( $header_info['description'] ) ) ? $header_no_bio = ' ctf-no-bio' : $header_no_bio = ""; |
| 14 | |
| 15 | $header_info = CTF_Parse::get_user_header_json( $feed_options, $tweet_set ); |
| 16 | $header_attr = CTF_Display_Elements::get_element_attribute( 'header', $feed_options ); |
| 17 | |
| 18 | $username = CTF_Parse::get_user_name( $header_info ); |
| 19 | $header_text = CTF_Parse::get_header_text( $header_info, $feed_options ); |
| 20 | $header_description = CTF_Parse::get_header_description( $header_info ); |
| 21 | $verified_account = ( $header_info['verified'] == 1 ) ? ctf_get_fa_el( 'fa-check-circle' ) . '<span class="ctf-screenreader">' . esc_html__( 'Verified account', 'custom-twitter-feeds' ) . '</span>' : ""; |
| 22 | $bio_attr = CTF_Display_Elements::get_element_attribute( 'headerbio', $feed_options ); |
| 23 | $avatar = CTF_Parse::get_header_avatar( $header_info, $feed_options ); |
| 24 | ?> |
| 25 | |
| 26 | <div class="ctf-header <?php echo $header_no_bio ?>" <?php echo $header_attr ?>> |
| 27 | <a href="<?php echo esc_url('https://twitter.com/' . $username . '/' ); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr( sprintf( __( '%s on Twitter', 'custom-twitter-feeds' ), $username ) ); ?>" title="@<?php echo esc_attr( $username ); ?>" class="ctf-header-link"> |
| 28 | <div class="ctf-header-text"> |
| 29 | <p class="ctf-header-user"> |
| 30 | <span class="ctf-header-name"><?php echo wp_kses_post( $header_text ); ?></span> |
| 31 | <span class="ctf-verified"><?php echo $verified_account; ?></span> |
| 32 | <span class="ctf-header-follow"> |
| 33 | <?php |
| 34 | if ( ctf_should_rebrand_to_x() ) { |
| 35 | $brand_icon = ctf_get_fa_el( 'fa-x' ); |
| 36 | } else { |
| 37 | $brand_icon = ctf_get_fa_el( 'fa-twitter' ); |
| 38 | } |
| 39 | echo $brand_icon . ' ' . esc_html__( 'Follow', 'custom-twitter-feeds' ); ?> |
| 40 | </span> |
| 41 | </p> |
| 42 | |
| 43 | <?php if ($feed_options['showbio'] && ! empty( $header_description ) || ctf_doing_customizer( $feed_options )) : ?> |
| 44 | <p class="ctf-header-bio" <?php echo $bio_attr ?> > |
| 45 | <?php echo wp_kses_post( $header_description ); ?> |
| 46 | </p> |
| 47 | <?php endif; ?> |
| 48 | </div> |
| 49 | |
| 50 | <div class="ctf-header-img"> |
| 51 | <div class="ctf-header-img-hover"> |
| 52 | <?php |
| 53 | if ( ctf_should_rebrand_to_x() ) { |
| 54 | echo ctf_get_fa_el( 'fa-x' ); |
| 55 | } else { |
| 56 | echo ctf_get_fa_el( 'fa-twitter' ); |
| 57 | } |
| 58 | ?> |
| 59 | </div> |
| 60 | <?php if ( CTF_GDPR_Integrations::doing_gdpr( $feed_options ) ) : ?> |
| 61 | <span data-avatar="<?php echo esc_url( CTF_Parse::get_avatar( $header_info ) ) ?>" data-alt="<?php echo esc_attr( $username ); ?>" style="display: none;"><?php esc_html_e( 'Avatar', 'custom-twitter-feeds' ); ?></span> |
| 62 | <?php else : ?> |
| 63 | <img src="<?php echo esc_url( $avatar ); ?>" alt="<?php echo esc_attr( $username ); ?>" width="48" height="48"> |
| 64 | <?php endif; ?> |
| 65 | </div> |
| 66 | </a> |
| 67 | </div> |
| 68 |