आप उदाहरण
wp_remote_get('http://www.example.com/index.php?action=foo', array('timeout' => 120, 'httpversion' => '1.1'));
के लिए wp_remote_get()
उपयोग कर सकते हैं आप भी हेडर और शरीर डेटा की तरह सभी अनुरोध मापदंडों पर नियंत्रण कर सकते हैं।
डिफ़ॉल्ट उपयोग
global $wp_version;
$args = array(
'timeout' => 5,
'redirection' => 5,
'httpversion' => '1.0',
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
'blocking' => true,
'headers' => array(),
'cookies' => array(),
'body' => null,
'compress' => false,
'decompress' => true,
'sslverify' => true,
'stream' => false,
'filename' => null
);
संदर्भ: More info
वहाँ एक प्लगइन WooCommerce https://wordpress.org/plugins/woo-razorpay/ लिए उपलब्ध है। हालांकि, यदि आप बिल्टिन वर्डप्रेस फ़ंक्शन का उपयोग करके कस्टम कॉल करना चाहते हैं, तो आप अनुरोध कक्षा का उपयोग कर सकते हैं। https://developer.wordpress.org/reference/classes/requests/ –