admin
6 years ago
add-to-wishlist-added.php
5 years ago
add-to-wishlist-browse.php
5 years ago
add-to-wishlist-button.php
5 years ago
add-to-wishlist-remove.php
5 years ago
add-to-wishlist.php
5 years ago
share.php
5 years ago
wishlist-view-footer-mobile.php
5 years ago
wishlist-view-footer.php
5 years ago
wishlist-view-header.php
5 years ago
wishlist-view-mobile.php
5 years ago
wishlist-view.php
6 years ago
wishlist.php
6 years ago
share.php
95 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Share template |
| 4 | * |
| 5 | * @author Your Inspiration Themes |
| 6 | * @package YITH WooCommerce Wishlist |
| 7 | * @version 3.0.0 |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Template variables: |
| 12 | * |
| 13 | * @var $share_title string Title for share section |
| 14 | * @var $share_facebook_enabled bool Whether to enable FB sharing button |
| 15 | * @var $share_twitter_enabled bool Whether to enable Twitter sharing button |
| 16 | * @var $share_pinterest_enabled bool Whether to enable Pintereset sharing button |
| 17 | * @var $share_email_enabled bool Whether to enable Email sharing button |
| 18 | * @var $share_whatsapp_enabled bool Whether to enable WhatsApp sharing button (mobile online) |
| 19 | * @var $share_url_enabled bool Whether to enable share via url |
| 20 | * @var $share_link_title string Title to use for post (where applicable) |
| 21 | * @var $share_link_url string Url to share |
| 22 | * @var $share_summary string Summary to use for sharing on social media |
| 23 | * @var $share_image_url string Image to use for sharing on social media |
| 24 | * @var $share_twitter_summary string Summary to use for sharing on Twitter |
| 25 | * @var $share_facebook_icon string Icon for facebook sharing button |
| 26 | * @var $share_twitter_icon string Icon for twitter sharing button |
| 27 | * @var $share_pinterest_icon string Icon for pinterest sharing button |
| 28 | * @var $share_email_icon string Icon for email sharing button |
| 29 | * @var $share_whatsapp_icon string Icon for whatsapp sharing button |
| 30 | * @var $share_whatsapp_url string Sharing url on whatsapp |
| 31 | */ |
| 32 | |
| 33 | if ( ! defined( 'YITH_WCWL' ) ) { |
| 34 | exit; |
| 35 | } // Exit if accessed directly |
| 36 | ?> |
| 37 | |
| 38 | <?php do_action( 'yith_wcwl_before_wishlist_share', $wishlist ); ?> |
| 39 | |
| 40 | <div class="yith-wcwl-share"> |
| 41 | <h4 class="yith-wcwl-share-title"><?php echo esc_html( $share_title ); ?></h4> |
| 42 | <ul> |
| 43 | <?php if ( $share_facebook_enabled ) : ?> |
| 44 | <li class="share-button"> |
| 45 | <a target="_blank" rel="noopener" class="facebook" href="https://www.facebook.com/sharer.php?u=<?php echo urlencode( $share_link_url ); ?>&p[title]=<?php echo esc_attr( $share_link_title ); ?>" title="<?php esc_html_e( 'Facebook', 'yith-woocommerce-wishlist' ); ?>"> |
| 46 | <?php echo $share_facebook_icon ? $share_facebook_icon : esc_html__( 'Facebook', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 47 | </a> |
| 48 | </li> |
| 49 | <?php endif; ?> |
| 50 | |
| 51 | <?php if ( $share_twitter_enabled ) : ?> |
| 52 | <li class="share-button"> |
| 53 | <a target="_blank" rel="noopener" class="twitter" href="https://twitter.com/share?url=<?php echo urlencode( $share_link_url ); ?>&text=<?php echo esc_attr( $share_twitter_summary ); ?>" title="<?php esc_html_e( 'Twitter', 'yith-woocommerce-wishlist' ); ?>"> |
| 54 | <?php echo $share_twitter_icon ? $share_twitter_icon : esc_html__( 'Twitter', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 55 | </a> |
| 56 | </li> |
| 57 | <?php endif; ?> |
| 58 | |
| 59 | <?php if ( $share_pinterest_enabled ) : ?> |
| 60 | <li class="share-button"> |
| 61 | <a target="_blank" rel="noopener" class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode( $share_link_url ); ?>&description=<?php echo esc_attr( $share_summary ); ?>&media=<?php echo esc_attr( $share_image_url ); ?>" title="<?php esc_html_e( 'Pinterest', 'yith-woocommerce-wishlist' ); ?>" onclick="window.open(this.href); return false;"> |
| 62 | <?php echo $share_pinterest_icon ? $share_pinterest_icon : esc_html__( 'Pinterest', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 63 | </a> |
| 64 | </li> |
| 65 | <?php endif; ?> |
| 66 | |
| 67 | <?php if ( $share_email_enabled ) : ?> |
| 68 | <li class="share-button"> |
| 69 | <a class="email" href="mailto:?subject=<?php echo esc_attr( apply_filters( 'yith_wcwl_email_share_subject', $share_link_title ) ); ?>&body=<?php echo esc_attr( apply_filters( 'yith_wcwl_email_share_body', urlencode( $share_link_url ) ) ); ?>&title=<?php echo esc_attr( $share_link_title ); ?>" title="<?php esc_html_e( 'Email', 'yith-woocommerce-wishlist' ); ?>"> |
| 70 | <?php echo $share_email_icon ? $share_email_icon : __( 'Email', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 71 | </a> |
| 72 | </li> |
| 73 | <?php endif; ?> |
| 74 | |
| 75 | <?php if ( $share_whatsapp_enabled ) : ?> |
| 76 | <li class="share-button"> |
| 77 | <a class="whatsapp" href="<?php echo esc_attr( $share_whatsapp_url ); ?>" data-action="share/whatsapp/share" target="_blank" rel="noopener" title="<?php esc_html_e( 'WhatsApp', 'yith-woocommerce-wishlist' ); ?>"> |
| 78 | <?php echo $share_whatsapp_icon ? $share_whatsapp_icon : esc_html__( 'Whatsapp', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 79 | </a> |
| 80 | </li> |
| 81 | <?php endif; ?> |
| 82 | </ul> |
| 83 | |
| 84 | <?php if ( $share_url_enabled ) : ?> |
| 85 | <div class="yith-wcwl-after-share-section"> |
| 86 | <input class="copy-target" readonly="readonly" type="url" name="yith_wcwl_share_url" id="yith_wcwl_share_url" value="<?php echo esc_attr( $share_link_url ); ?>"/> |
| 87 | <?php echo ( ! empty( $share_link_url ) ) ? sprintf( '<small>%s <span class="copy-trigger">%s</span> %s</small>', esc_html__( '(Now', 'yith-woocommerce-wishlist' ), esc_html__( 'copy', 'yith-woocommerce-wishlist' ), esc_html__( 'this wishlist link and share it anywhere)', 'yith-woocommerce-wishlist' ) ) : ''; ?> |
| 88 | </div> |
| 89 | <?php endif; ?> |
| 90 | |
| 91 | <?php do_action( 'yith_wcwl_after_share_buttons', $share_link_url, $share_title, $share_link_title ); ?> |
| 92 | </div> |
| 93 | |
| 94 | <?php do_action( 'yith_wcwl_after_wishlist_share', $wishlist ); ?> |
| 95 |