Tuesday, November 8, 2022
HomeWordPress DevelopmentOn the identical web site, how do I ship information from a...

On the identical web site, how do I ship information from a plugin file to a theme file?


I hope you take pleasure in taking a look at your monitor.

My head blew after two days of onerous work and experimenting with numerous strategies. 

I am having bother sending variable information (string: hyperlink) from a plugin to a theme file to course of and return one thing.

That is how I exploit curl

$dirrrr="https://mysite.on-line/wp-content/themes/my-theme/libs/addons/consists of/scrapdata.php";

$p_link = 'https://examplesite.com/black-kinemaster-1.html';

$p = $p_link;

$ch = curl_init($dirrrr);

$information = "p=$p" ; //or array('p'=> $p)

curl_setopt($ch, CURLOPT_POST,1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $information);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
curl_setopt($ch, CURLOPT_HEADER      ,0);  // DO NOT RETURN HTTP HEADERS
curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);  // RETURN THE CONTENTS OF THE CALL
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$Rec_Data = curl_exec($ch);

What’s the greatest technique for sending information between plugins? (Is it wp hooks? if I am not in wordpress cms and simply utilizing pure php?)

thanks

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments