最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Could add_query_arg() redirect user to external site?

programmeradmin2浏览0评论

I was reading this to learn to create my own WooC payment gateway. It says,

But if you want the customer to process the payment on the gateway website then use the add_query_arg() function instead.

Could I use add_query_arg() to process the payment outside of my site such as add_query_arg( 'key', 'value', '' ); by redirecting my user to that site outside of mine?

I was reading this to learn to create my own WooC payment gateway. It says,

But if you want the customer to process the payment on the gateway website then use the add_query_arg() function instead.

Could I use add_query_arg() to process the payment outside of my site such as add_query_arg( 'key', 'value', 'http://externalpaymentsite.com' ); by redirecting my user to that site outside of mine?

Share Improve this question asked Mar 10, 2022 at 2:28 ratib90486ratib90486 295 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The function add_query_arg() will generate a link with query parameters.

You should also handle the redirect additionally. Something like this will work:

$url = add_query_arg('key', 'value', 'http://externalpaymentsite.com');
wp_redirect($url)
exit;
发布评论

评论列表(0)

  1. 暂无评论