2023-01-21 01:31:34 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Partial: Sharing Modal
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Fictioneer
|
2024-01-26 17:45:59 +01:00
|
|
|
* @since 4.0.0
|
2024-04-15 02:21:43 +02:00
|
|
|
* @since 5.14.0 - Account for redirect link in story.
|
2024-10-20 13:02:47 +02:00
|
|
|
* @since 5.25.0 - Added Bluesky, removed WhatsApp and Telegram, reordered buttons.
|
2023-01-21 01:31:34 +01:00
|
|
|
*/
|
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
|
|
|
|
// No direct access!
|
|
|
|
defined( 'ABSPATH' ) OR exit;
|
|
|
|
|
2024-04-15 01:31:53 +02:00
|
|
|
// Setup
|
|
|
|
$story_link = get_post_meta( get_the_ID(), 'fictioneer_story_redirect_link', true ) ?: get_permalink( get_the_ID() );
|
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
?>
|
|
|
|
|
2024-12-06 17:38:32 +01:00
|
|
|
<div id="sharing-modal" class="sharing modal" data-fictioneer-target="modal" data-action="click->fictioneer#backgroundCloseModals keydown.esc@document->fictioneer#closeModals" data-nosnippet hidden>
|
2023-01-21 01:31:34 +01:00
|
|
|
<div class="modal__wrapper">
|
2024-12-06 17:38:32 +01:00
|
|
|
|
|
|
|
<button class="close" aria-label="<?php esc_attr_e( 'Close modal', 'fictioneer' ); ?>" data-action="click->fictioneer#closeModals"><?php fictioneer_icon( 'fa-xmark' ); ?></button>
|
|
|
|
|
2024-03-14 00:33:00 +01:00
|
|
|
<div class="modal__header drag-anchor"><?php _ex( 'Share', 'Share modal heading.', 'fictioneer' ); ?></div>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
|
|
|
<div class="modal__row media-buttons _modal">
|
2024-10-20 12:59:26 +02:00
|
|
|
<?php if ( ! get_option( 'fictioneer_disable_bluesky_share' ) ) : ?>
|
|
|
|
<a href="https://bsky.app/intent/compose?text=<?php echo $story_link; ?>" target="_blank" rel="noopener nofollow" class="media-buttons__item bluesky">
|
|
|
|
<i class="fab fa-bluesky"></i>
|
2023-01-21 01:31:34 +01:00
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php if ( ! get_option( 'fictioneer_disable_twitter_share' ) ) : ?>
|
2024-10-20 12:59:26 +02:00
|
|
|
<a href="https://twitter.com/intent/tweet/?text=<?php the_title(); ?>&url=<?php echo $story_link; ?>" target="_blank" rel="noopener nofollow" class="media-buttons__item twitter">
|
2023-01-21 01:31:34 +01:00
|
|
|
<i class="fab fa-twitter"></i>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php if ( ! get_option( 'fictioneer_disable_tumblr_share' ) ) : ?>
|
2024-10-20 12:59:26 +02:00
|
|
|
<a href="http://tumblr.com/widgets/share/tool?canonicalUrl=<?php echo $story_link; ?>" target="_blank" rel="noopener nofollow" class="media-buttons__item tumblr">
|
2023-01-21 01:31:34 +01:00
|
|
|
<i class="fa-brands fa-tumblr-square"></i>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php if ( ! get_option( 'fictioneer_disable_reddit_share' ) ) : ?>
|
2024-10-20 12:59:26 +02:00
|
|
|
<a href="http://www.reddit.com/submit?url=<?php echo $story_link; ?>&title=<?php echo urlencode( get_the_title() ); ?>" target="_blank" rel="noopener nofollow" class="media-buttons__item reddit">
|
2023-01-21 01:31:34 +01:00
|
|
|
<i class="fa-brands fa-reddit"></i>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php if ( ! get_option( 'fictioneer_disable_mastodon_share' ) ) : ?>
|
2024-10-20 12:59:26 +02:00
|
|
|
<a href="https://toot.kytta.dev/?text=Check%20out%20<?php echo $story_link; ?>" target="_blank" rel="noopener nofollow" class="media-buttons__item mastodon">
|
2023-01-21 01:31:34 +01:00
|
|
|
<i class="fa-brands fa-mastodon"></i>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
2024-10-20 12:59:26 +02:00
|
|
|
|
|
|
|
<?php if ( ! get_option( 'fictioneer_disable_facebook_share' ) ) : ?>
|
|
|
|
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $story_link; ?>" target="_blank" rel="noopener nofollow" class="media-buttons__item facebook">
|
|
|
|
<i class="fab fa-facebook"></i>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal__row">
|
2024-12-06 17:38:32 +01:00
|
|
|
<input type="text" value="<?php echo $story_link; ?>" data-action="click->fictioneer#copyInput" data-message="<?php _e( 'Link copied to clipboard!', 'fictioneer' ); ?>" name="permalink" readonly>
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
2024-12-06 17:38:32 +01:00
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
|
|
|
</div>
|