0
私は問題なく動作するカールを使用して削除イメージを置き換えるこのコードを持っていますが、これを達成するためにワードプレスネイティブ関数を使用したいと思います。wordpressのcurl_setoptの代わりに
function image($destination_path, $remote_image_link) {
$ch = curl_init($remote_image_link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
if ($result) {
$rv = file_put_contents($destination_path, $result);
}
}
wp_remote
と同じ達成したいか、他のいくつかの機能の.ANYヘルプは
明確ではないとして、それが誰かの役に立てば幸いwp_remote_get'? – smoqadam
@smoqadamはいここにその1つを使用する方法 – swetlana
https://codex.wordpress.org/Function_Reference/wp_remote_get – smoqadam