PluginProbe ʕ •ᴥ•ʔ
YITH WooCommerce Wishlist / 3.18.0
YITH WooCommerce Wishlist v3.18.0
trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.25 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.10.0 3.11.0 3.12.0 3.13.0 3.14.0 3.15.0 3.16.0 3.17.0 3.18.0 3.19.0 3.2.0 3.20.0 3.21.0 3.22.0 3.23.0 3.24.0 3.25.0 3.26.0 3.27.0 3.28.0 3.29.0 3.3.0 3.30.0 3.31.0 3.32.0 3.33.0 3.34.0 3.35.0 3.36.0 3.37.0 3.38.0 3.4.0 3.5.0 3.6.0 3.7.0 3.8.0 3.9.0 4.0.0 4.0.1 4.1.0 4.10.0 4.10.1 4.10.2 4.11.0 4.12.0 4.13.0 4.14.0 4.15.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.8.0 4.9.0
yith-woocommerce-wishlist / templates / share.php
yith-woocommerce-wishlist / templates Last commit date
add-to-wishlist-added.php 3 years ago add-to-wishlist-browse.php 3 years ago add-to-wishlist-button.php 3 years ago add-to-wishlist-remove.php 3 years ago add-to-wishlist.php 4 years ago share.php 3 years ago wishlist-view-footer-mobile.php 3 years ago wishlist-view-footer.php 3 years ago wishlist-view-header.php 3 years ago wishlist-view-mobile.php 3 years ago wishlist-view.php 3 years ago wishlist.php 3 years ago
share.php
148 lines
1 <?php
2 /**
3 * Share template
4 *
5 * @author YITH
6 * @package YITH\Wishlist\Templates
7 * @version 3.0.0
8 */
9
10 /**
11 * Template variables:
12 *
13 * @var $wishlist YITH_WCWL_Wishlist Wishlist object
14 * @var $share_title string Title for share section
15 * @var $share_facebook_enabled bool Whether to enable FB sharing button
16 * @var $share_twitter_enabled bool Whether to enable Twitter sharing button
17 * @var $share_pinterest_enabled bool Whether to enable Pintereset sharing button
18 * @var $share_email_enabled bool Whether to enable Email sharing button
19 * @var $share_whatsapp_enabled bool Whether to enable WhatsApp sharing button (mobile online)
20 * @var $share_url_enabled bool Whether to enable share via url
21 * @var $share_link_title string Title to use for post (where applicable)
22 * @var $share_link_url string Url to share
23 * @var $share_summary string Summary to use for sharing on social media
24 * @var $share_image_url string Image to use for sharing on social media
25 * @var $share_twitter_summary string Summary to use for sharing on Twitter
26 * @var $share_facebook_icon string Icon for facebook sharing button
27 * @var $share_twitter_icon string Icon for twitter sharing button
28 * @var $share_pinterest_icon string Icon for pinterest sharing button
29 * @var $share_email_icon string Icon for email sharing button
30 * @var $share_whatsapp_icon string Icon for whatsapp sharing button
31 * @var $share_whatsapp_url string Sharing url on whatsapp
32 */
33
34 if ( ! defined( 'YITH_WCWL' ) ) {
35 exit;
36 } // Exit if accessed directly
37 ?>
38
39 <?php
40 // we want spaces to be encoded as + instead of %20, so we use urlencode instead of rawurlencode.
41 // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
42
43 /**
44 * DO_ACTION: yith_wcwl_before_wishlist_share
45 *
46 * Allows to render some content or fire some action before the share wishlist section.
47 */
48 do_action( 'yith_wcwl_before_wishlist_share', $wishlist );
49 ?>
50
51 <div class="yith-wcwl-share">
52 <h4 class="yith-wcwl-share-title"><?php echo esc_html( $share_title ); ?></h4>
53 <ul>
54 <?php if ( $share_facebook_enabled ) : ?>
55 <li class="share-button">
56 <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' ); ?>">
57 <?php echo $share_facebook_icon ? yith_wcwl_kses_icon( $share_facebook_icon ) : esc_html__( 'Facebook', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
58 </a>
59 </li>
60 <?php endif; ?>
61
62 <?php if ( $share_twitter_enabled ) : ?>
63 <li class="share-button">
64 <a target="_blank" rel="noopener" class="twitter" href="https://twitter.com/share?url=<?php echo urlencode( $share_link_url ); ?>&amp;text=<?php echo esc_attr( $share_twitter_summary ); ?>" title="<?php esc_html_e( 'Twitter', 'yith-woocommerce-wishlist' ); ?>">
65 <?php echo $share_twitter_icon ? yith_wcwl_kses_icon( $share_twitter_icon ) : esc_html__( 'Twitter', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
66 </a>
67 </li>
68 <?php endif; ?>
69
70 <?php if ( $share_pinterest_enabled ) : ?>
71 <li class="share-button">
72 <a target="_blank" rel="noopener" class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode( $share_link_url ); ?>&amp;description=<?php echo esc_attr( $share_summary ); ?>&amp;media=<?php echo esc_attr( $share_image_url ); ?>" title="<?php esc_html_e( 'Pinterest', 'yith-woocommerce-wishlist' ); ?>" onclick="window.open(this.href); return false;">
73 <?php echo $share_pinterest_icon ? yith_wcwl_kses_icon( $share_pinterest_icon ) : esc_html__( 'Pinterest', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
74 </a>
75 </li>
76 <?php endif; ?>
77
78 <?php if ( $share_email_enabled ) : ?>
79 <li class="share-button">
80 <?php
81 /**
82 * APPLY_FILTERS: yith_wcwl_email_share_subject
83 *
84 * Filter the subject for the share email.
85 *
86 * @param string $subject Email subject
87 *
88 * @return string
89 */
90
91 /**
92 * APPLY_FILTERS: yith_wcwl_email_share_body
93 *
94 * Filter the body for the share email.
95 *
96 * @param string $body Email body
97 *
98 * @return string
99 */
100
101 ?>
102 <a class="email" href="mailto:?subject=<?php echo esc_attr( apply_filters( 'yith_wcwl_email_share_subject', $share_link_title ) ); ?>&amp;body=<?php echo esc_attr( apply_filters( 'yith_wcwl_email_share_body', urlencode( $share_link_url ) ) ); ?>&amp;title=<?php echo esc_attr( $share_link_title ); ?>" title="<?php esc_html_e( 'Email', 'yith-woocommerce-wishlist' ); ?>">
103 <?php echo $share_email_icon ? yith_wcwl_kses_icon( $share_email_icon ) : __( 'Email', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
104 </a>
105 </li>
106 <?php endif; ?>
107
108 <?php if ( $share_whatsapp_enabled ) : ?>
109 <li class="share-button">
110 <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' ); ?>">
111 <?php echo $share_whatsapp_icon ? yith_wcwl_kses_icon( $share_whatsapp_icon ) : esc_html__( 'Whatsapp', 'yith-woocommerce-wishlist' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
112 </a>
113 </li>
114 <?php endif; ?>
115 </ul>
116
117 <?php if ( $share_url_enabled ) : ?>
118 <div class="yith-wcwl-after-share-section">
119 <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 ); ?>"/>
120 <?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' ) ) : ''; ?>
121 </div>
122 <?php endif; ?>
123
124 <?php
125 /**
126 * DO_ACTION: yith_wcwl_after_share_buttons
127 *
128 * Allows to render some content or fire some action after the share buttons in the Wishlist page.
129 *
130 * @param string $share_link_url Share link URL
131 * @param string $share_title Share title
132 * @param string $share_link_title Share link title
133 */
134 do_action( 'yith_wcwl_after_share_buttons', $share_link_url, $share_title, $share_link_title );
135 ?>
136 </div>
137
138 <?php
139 /**
140 * DO_ACTION: yith_wcwl_after_wishlist_share
141 *
142 * Allows to render some content or fire some action after the share wishlist section.
143 */
144 do_action( 'yith_wcwl_after_wishlist_share', $wishlist );
145
146 // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
147 ?>
148