admin管理员组文章数量:1323335
I have a problem with a plugin I'm working on, I have implemented a cron that 2 times a day makes a call to update the data, the call is made with the wp_remote_post function.
$response = wp_remote_post(
ENDPOINT,
array(
'method' => 'POST',
'headers' => array(
'Content-Type' => 'application/json; charset=utf-8',
'domainUrl' => get_site_url(),
),
'body' => wp_json_encode( $body ),
)
);
the problem is in the get_site_url()
function.
For a site that uses the https protocol, get_site_url()
returns the domain in https when the call is triggered from the frontend or wordpress hooks except cron, instead when get_site_url()
is triggered by the cron hook it returns http.
What may be causing this behavior and how I could fix it?
Thanks
本文标签: httpsCron and request with wpremotepost
版权声明:本文标题:https - Cron and request with wp_remote_post 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742137521a2422436.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论