Created
October 1, 2018 08:58
-
-
Save New0/2faa2158fb7bb4209a0d3f6b165e1fec to your computer and use it in GitHub Desktop.
Edit the T&C text and link of a Direct Stripe button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Use this filter to edit the T&C text and link of a Direct Stripe button | |
*/ | |
add_filter( 'direct_stripe_tc_conditions', function( $tc_cond, $button_id, $instance, $tc_text, $tc_link, $tc_link_text){ | |
if( $button_id !== 'MyButtonID') { //EDIT MyButtonID to be the Button CSS ID set in the button settings | |
return $tc_cond; | |
} | |
$tc_cond = '<br/><input type="checkbox" class="ds-conditions" id="ds-conditions-' . $instance . '" required/> | |
<label for="conditions"> | |
' . __('By following you accept our', 'theme-or-plugin-slug') . ' | |
<a target="_blank" href="' . esc_url($tc_link) . '">' . $tc_link_text . '</a> | |
' . __('and our', 'theme-or-plugin-slug') . ' | |
<a target="_blank" href="https://domain.ext/privacy-policy">' . __('Privacy policies', 'theme-or-plugin-slug') . '</a> | |
</label><br />'; | |
return $tc_cond; | |
}, 10, 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rewrite the condition for multiple buttons :
if ( ! in_array( $button_id, array( 'firstButtonID', 'secondButtonID', 'thirdButtonID' ) ) )