fix(share): mobile share chrome and tabbar poster entry
Use a bottom sheet share panel on small screens and add a one-tap poster button to the single-post footer tabbar extend.
This commit is contained in:
@@ -1357,16 +1357,33 @@ if (!function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
endif;
|
||||
|
||||
if ($share_on) :
|
||||
$share_title = get_the_title($post_id);
|
||||
$share_url = get_permalink($post_id) ?: '';
|
||||
$share_image = get_the_post_thumbnail_url($post_id, 'large') ?: '';
|
||||
?>
|
||||
<button type="button"
|
||||
class="tabbar-item single-action-tabbar action-share"
|
||||
data-type="share"
|
||||
data-share-title="<?php echo esc_attr((string) $share_title); ?>"
|
||||
data-share-url="<?php echo esc_url((string) $share_url); ?>"
|
||||
<?php if ($share_image !== '') : ?>data-share-image="<?php echo esc_url((string) $share_image); ?>"<?php endif; ?>
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
aria-label="<?php esc_attr_e('分享', 'aksrt'); ?>">
|
||||
<i class="fas fa-share-alt" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span><?php esc_html_e('分享', 'aksrt'); ?></span><?php endif; ?>
|
||||
</button>
|
||||
<button type="button"
|
||||
class="tabbar-item single-action-tabbar action-poster"
|
||||
data-type="poster"
|
||||
data-share-platform="poster"
|
||||
data-share-title="<?php echo esc_attr((string) $share_title); ?>"
|
||||
data-share-url="<?php echo esc_url((string) $share_url); ?>"
|
||||
<?php if ($share_image !== '') : ?>data-share-image="<?php echo esc_url((string) $share_image); ?>"<?php endif; ?>
|
||||
aria-label="<?php esc_attr_e('海报', 'aksrt'); ?>">
|
||||
<i class="fas fa-image" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span><?php esc_html_e('海报', 'aksrt'); ?></span><?php endif; ?>
|
||||
</button>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user