Skip to content

Commit 7a4add6

Browse files
authored
Merge pull request #393 from skyverge/ch22169-update-terms-and-conditions-link
Move creation of terms and conditions link to render_terms_notice()
2 parents 1f4415c + 7f5c1ce commit 7a4add6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,25 @@ public function render_button() {
194194
*/
195195
public function render_terms_notice() {
196196

197-
/** This filter is documented by WordPress in templates/checkout/terms.php */
197+
/** This filter is documented by WooCommerce in templates/checkout/terms.php */
198198
if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) && wc_terms_and_conditions_checkbox_enabled() ) {
199199

200200
$default_text = sprintf(
201-
/** translators: Placeholders: %s - [terms] placeholder, will be replaced by terms link */
202-
__( 'By submitting your payment, you agree to our %s.', 'woocommerce-plugin-framework' ),
203-
'[terms]'
201+
/** translators: Placeholders: %1$s - opening HTML link tag pointing to the terms & conditions page, %2$s closing HTML link tag */
202+
__( 'By submitting your payment, you agree to our %1$sterms and conditions%2$s.', 'woocommerce-plugin-framework' ),
203+
'<a href="' . esc_url( get_permalink( wc_terms_and_conditions_page_id() ) ) . '" class="sv-wc-apple-pay-terms-and-conditions-link" target="_blank">',
204+
'</a>'
204205
);
205206

206207
/**
207-
* Allows to filter the notice text, use the [terms] shortcode to insert a link to the terms & conditions page.
208+
* Allows to filter the text for the terms & conditions notice.
208209
*
209210
* @since 5.5.4
210211
*
211212
* @params string $default_text default notice text
212213
*/
213214
$text = apply_filters( 'sv_wc_apple_pay_terms_notice_text', $default_text );
214215

215-
$text = wc_replace_policy_page_link_placeholders( $text );
216-
217216
?>
218217
<div class="sv-wc-apple-pay-terms woocommerce-terms-and-conditions-wrapper">
219218
<p><small><?php echo wp_kses_post( $text ); ?></small></p>

0 commit comments

Comments
 (0)