Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1287581
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 3 years ago.
Improve this questionI can change the translatable area of terms and conditions or privacy policy area but didn't find any way to change the "privacy policy" and "terms and conditions" text of the link.
For example, the text is:
I have read and agree to the website terms and conditions
I can change the bold area from customizer> woocommerce section. but there is no way to change "terms and conditions". is there any way to change that text?
Thanks
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 3 years ago.
Improve this questionI can change the translatable area of terms and conditions or privacy policy area but didn't find any way to change the "privacy policy" and "terms and conditions" text of the link.
For example, the text is:
I have read and agree to the website terms and conditions
I can change the bold area from customizer> woocommerce section. but there is no way to change "terms and conditions". is there any way to change that text?
Thanks
Share Improve this question asked Oct 4, 2021 at 11:55 Emtiaz ZahidEmtiaz Zahid 1035 bronze badges 4- This is a third party plugin support question, and should be directed to their support forum: wordpress/support/plugin/woocommerce – Jacob Peattie Commented Oct 4, 2021 at 12:01
- my bad. actually my first question here. should I remove this and post it to plugin support or wait for someone for help? – Emtiaz Zahid Commented Oct 4, 2021 at 12:04
- 1 Post it to plugin support. Third party plugins are off topic here. – Jacob Peattie Commented Oct 4, 2021 at 12:06
- the privacy policy shortcode may be the standard privacy policy text from WP Core settings, but you should contact WooCommerce support or as in one of their communities, 3rd party plugin support is offtopic here – Tom J Nowell ♦ Commented Oct 4, 2021 at 13:08
1 Answer
Reset to default 1After some digging in WooCommerce github and WordPress github I can say that there isn't a filter, in WooCommerce, to change that specific text.
What you can do is hook into pre_kses
, because that what WooCommerce uses to handle the output and look for privacy policy, change it to what ever you want and you are ready.
Problem is that it will affect all other privacy policy texts that use the same function so do some tests before you go live with this.
Same goes for "terms and conditions" text.
add_filter('pre_kses', 'bt_change_policy_and_conditions_texts');
function bt_change_policy_and_conditions_texts ($string) {
if (strpos($string, 'privacy policy') !== false) {
// change 'Something else' to what ever you need
return str_replace('privacy policy', 'Something else', $string);
}
if (strpos($string, 'terms and conditions') !== false) {
// change 'Something else 2' to what ever you need
return str_replace('terms and conditions', 'Something else 2', $string);
}
return $string;
}
This goes into functions.php
.
本文标签: How to change woocommerce checkout privacy policyterms and condition text
版权声明:本文标题:How to change woocommerce checkout privacy policy, terms and condition text 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741287697a2370367.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论