Articles of api

Theme Customization API Changes not Saving

I’m having some trouble using the Theme Customization API for the first time. I’m following a tutorial, but I seem to be doing something wrong. I’m trying to allow users to change text on a page through the WordPress Theme Customization options. I’ve added all the hooks to my functions.php file and a separate .js […]

WP AJAX API with JS file

So I am having a hard time trying to set my contact form working on a theme I am building. It uses JqBootstrapValidation plugin. Someone told me that the reason this is not working is because WP is not being loaded when js is calling via AJAX the contact-me.php file. So, if someone could implement […]

Implement External API into WordPress

I am trying to implement parts of an external api found here ( into my wordpress theme. However I have no idea to get the data from X to Y. I have tried using this code $uri = ‘’; $reqPrefs[‘http’][‘method’] = ‘GET’; $stream_context = stream_context_create($reqPrefs); $response = file_get_contents($uri, false, $stream_context); $fixtures = json_decode($response); echo stripslashes($fixtures); […]

Integrate WooCommerce to PromoSoftware Rest API

Hi guys been trying to get WooCommerce to send customer details via API to PromoSoftware Promosoftware api info add_action(‘woocommerce_thankyou’, ‘send_order_to_ext’); function wdm_send_order_to_ext( ){ $api = new RestClient(array( ‘base_url’ => “”, ‘format’ => “php”, )); $addArray=array( $addArray[‘ContactFirstName’] = ‘Dave’, $addArray[‘ContactLastName’]=’Davison’, $addArray[‘ContactEmail’]=’’, $addArray[‘ContactSalutation’]=’Davo’, $addArray[‘CompanyId’]=12,//INT $result=$api->post(‘contact’,$addArray), json_decode($result->response),//returnsstdClassobject json_decode($result->response,true),//returnsassocarray ); var_dump($result); } Im using php-restclient from github… totally lost […]

Can i use init hook for API purpose?

My question title might be little confuse. Here is the scenario, For example: I am giving an API service from my wordpress site. Using it others can know few information. Like if they send a User ID in query URL then i’ll send them user phone number. For Example: If they access the site with […]

Google Places API With ACF

I’m creating a site that has a Venue custom post type, and one of the custom fields (using advanced custom fields) is the hours of operation for the business. I was going to manually find this information and plug it in myself, but that’s a lot of work, and it changes seasonally, which Vermont has […]

What is this HTTP_REFERRER “WordPress/4.1.2”

On our website we have huge traffic with same IP and referrer “WordPress/4.1.2;”. The log line looks like: – – [22/Apr/2015:17:28:15 +0200] “GET /wp-content/uploads/2015/04/randevouz.jpg HTTP/1.0” 200 791898 “-” “WordPress/4.1.2;” The IP and domain are real and I can see the website who doing it, but before block I want to know […]

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 […]

WordPress API – count posts

Is there a way to count the number of posts / pages via the WordPress API? I’m wanting to insert a post then check, using the API, that the count has gone up by 1. I’ve looked at

Help using acf/save_post hook to connect to Untappd API and update_field

What I am trying to accomplish is: when I save a or update a post, I want to access the Untappd API, grab a link to an image, and update an ACF field with that link. I am attempting to use the acf/save_post hook to accomplish this. Here is what I have so far: function […]