Articles of curl

Use WordPress user database in external php application

As the title tells I’m looking for a solution on how to use my wordpress database in an external php application. I want to use WordPress because I want only one place for users. One place one password. I tried including the wordpress blog header but it only works on my blog domain, and not […]

Using PODS data with save_post

I’m trying to use the save_post hook to send an SMS to a telephone number entered into a PODS custom post type. The SMS should be sent when the record is saved. add_action( ‘save_post_appointment’, ‘sendsms_save’ ); function sendsms_save() { $username = ‘username’; $password = ‘password’; $msisdn = $_POST[“mobile”]; $content=”Hi”; $data = “username=”.$username.”&password=”.$password.”&message=”.urlencode($content).”&msisdn=”.urlencode($msisdn); $ch = curl_init(‘http://bulksms.com/eapi/submission/send_sms/2/2.0’); […]

Update File Once Every 30 Days

I’m building a plugin that requires a database file which is updated monthly. I would like to write a function that automatically replaces the old file once every 30 days. Here’s what I have so far. Am I on the right track? add_action( ‘plugins_loaded’, ‘update_some_file’ ); function update_some_file() { $remotefile = curl_init(‘http://www.somesite.com/somefile.dat’); curl_setopt($remotefile, CURLOPT_NOBODY, true); […]

cURL error 6 on news area, and also won't auto update

I’m trying to get my blog to work with the auto-updates, after recently getting hit with a “hack” where someone overwrote an article (nothing too malicious, but we lost the article). The problem is that the auto updates don’t seem to work. I’m not sure if this is related, but I get this error on […]

curl problem or permalinks

I just configured my VPS, I am using Centos, everything works fine, but if I am setting my permalinks to Custom Structure, then accept the homepage none of the posts come, it shows me 404 page, I think this is because I haven’t enabled curl, but I don’t know where is my php.ini file in […]

Why is json_decode failing?

I’m trying to determine if this is related to my having the latest version of PHP on my server while using the latest version of WordPress. Or if I’m just doing it wrong: Here’s my function that is correctly returning values (I can see them when I do an echo or a var dump): function […]

get post content of particular post by url

I want to get the post content of particular post using Curl or any other methods from third party website is it possible? As the structure remains the same <entry-content> i guess there should be some way to fetch the data. Any plugins-suggestion are also welcomed.

WP OAuth Server “The grant type was not specified in the request”

I’ve installed WP OAuth Server to make an SSO thing with my WordPress, but I can’t get it to work proper. I followed this example on how to set up Single Sign On. I’m stuck at Step 3. I get this error: object(stdClass)#1 (2) { [“error”]=> string(15) “invalid_request” [“error_description”]=> string(47) “The grant type was not […]

How to send file by wp_remote_post?

I don’t want cURL in my WordPress plugin Hi, cURL is not safe to use on WordPress site. And sometime, cURL has been disable on customer hosting. And i decided to use wp_remote_post to send file for my plugin Here my code : $service = URL SERVICE ; $headers = array( ‘accept’ => ‘application/json’, // […]

Login worpress website using wp-rest api

Hi iam using WordPress 4.8 and i am new to rest api . I have 2 websites , one is www.example.com and second is www.example.com/site2. That is second website is installed inside the first . In example.com i have many users. In site 2 , i have a custom page & in that page i […]