Skip to content

Commit

Permalink
adding x for sharing instead of twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyvr committed Aug 22, 2023
1 parent c4d2f06 commit 586c87c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions includes/elb-social-logos.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function elb_get_social_logo( $social_logo, $args = array() ) {
case 'twitter-alt':
$svg = '<svg class="' . esc_attr( $args['class'] ) . ' elb-liveblog-social-logo-twitter-alt" fill="currentColor" height="' . esc_attr( $args['height'] ) . '" width="' . esc_attr( $args['width'] ) . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M22.23 5.924a8.212 8.212 0 01-2.357.646 4.115 4.115 0 001.804-2.27 8.221 8.221 0 01-2.606.996 4.103 4.103 0 00-6.991 3.742 11.647 11.647 0 01-8.457-4.287 4.087 4.087 0 00-.556 2.063 4.1 4.1 0 001.825 3.415 4.09 4.09 0 01-1.859-.513v.052a4.104 4.104 0 003.292 4.023 4.099 4.099 0 01-1.853.07 4.11 4.11 0 003.833 2.85 8.236 8.236 0 01-5.096 1.756 8.33 8.33 0 01-.979-.057 11.617 11.617 0 006.29 1.843c7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.531a8.298 8.298 0 002.047-2.123z"/></g></svg>';
break;
case 'x':
$svg = '<svg class="' . esc_attr( $args['class'] ) . ' elb-liveblog-social-logo-twitter" fill="currentColor" height="' . esc_attr( $args['height'] ) . '" width="' . esc_attr( $args['width'] ) . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path></g></svg>';
break;
case 'whatsapp':
$svg = '<svg class="' . esc_attr( $args['class'] ) . ' elb-liveblog-social-logo-whatsapp" fill="currentColor" height="' . esc_attr( $args['height'] ) . '" width="' . esc_attr( $args['width'] ) . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M2.048 22l1.406-5.136a9.894 9.894 0 01-1.323-4.955C2.133 6.446 6.579 2 12.042 2a9.848 9.848 0 017.011 2.906 9.85 9.85 0 012.9 7.011c-.002 5.464-4.448 9.91-9.91 9.91h-.004a9.913 9.913 0 01-4.736-1.206L2.048 22zm5.497-3.172l.301.179a8.214 8.214 0 004.193 1.148h.003c4.54 0 8.235-3.695 8.237-8.237a8.189 8.189 0 00-2.41-5.828 8.182 8.182 0 00-5.824-2.416c-4.544 0-8.239 3.695-8.241 8.237a8.222 8.222 0 001.259 4.384l.196.312-.832 3.04 3.118-.819zm9.49-4.554c-.062-.103-.227-.165-.475-.289-.248-.124-1.465-.723-1.692-.806-.227-.083-.392-.124-.557.124-.165.248-.64.806-.784.971-.144.165-.289.186-.536.062-.248-.124-1.046-.385-1.991-1.229-.736-.657-1.233-1.468-1.378-1.715-.144-.248-.015-.382.109-.505.111-.111.248-.289.371-.434.124-.145.165-.248.248-.413.083-.165.041-.31-.021-.434s-.557-1.343-.763-1.839c-.202-.483-.407-.417-.559-.425-.144-.007-.31-.009-.475-.009a.91.91 0 00-.66.31c-.226.248-.866.847-.866 2.066 0 1.219.887 2.396 1.011 2.562.124.165 1.746 2.666 4.23 3.739.591.255 1.052.408 1.412.522.593.189 1.133.162 1.56.098.476-.071 1.465-.599 1.671-1.177.206-.58.206-1.075.145-1.179z"/></g></svg>';
break;
Expand Down
4 changes: 2 additions & 2 deletions templates/sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<?php echo elb_get_social_logo( 'facebook' ); ?>
</a>

<a href="https://twitter.com/intent/tweet?text=<?php elb_entry_title(); ?> <?php echo elb_get_entry_url(); ?>" target="_blank" title="<?php _e( 'Share via Twitter', ELB_TEXT_DOMAIN ); ?>">
<?php echo elb_get_social_logo( 'twitter-alt' ); ?>
<a href="https://x.com/intent/tweet?text=<?php elb_entry_title(); ?> <?php echo elb_get_entry_url(); ?>" target="_blank" title="<?php _e( 'Share via X/Twitter', ELB_TEXT_DOMAIN ); ?>">
<?php echo elb_get_social_logo( 'x' ); ?>
</a>

<a href="mailto:?&subject=<?php elb_entry_title(); ?>&body=<?php echo elb_get_entry_url(); ?>" target="_blank" title="<?php _e( 'Share via email', ELB_TEXT_DOMAIN ); ?>">
Expand Down

0 comments on commit 586c87c

Please sign in to comment.