fictioneer/partials/_modal-sharing.php

72 lines
3.2 KiB
PHP
Raw Normal View History

2023-01-21 01:31:34 +01:00
<?php
/**
* Partial: Sharing Modal
*
* @package WordPress
* @subpackage Fictioneer
* @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
*/
// 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() );
?>
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">
<?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' ) ) : ?>
<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' ) ) : ?>
<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' ) ) : ?>
<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' ) ) : ?>
<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; ?>
<?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>