upload image with rest API to the media library

Does functions.php continuously execute while WordPress is running? Yes, it’s run on each page load. You can learn more about the (theme) functions file at https://developer.wordpress.org/themes/basics/theme-functions/. Should this be in functions.php file and how do i get it to execute only once? It can be put in that file, however, it should be run conditionally, … Read more

wp_remote_post() and Pem certificates

No, there are no provisions in wp_remote_post for those parameters. wp_remote_post is a high level abstraction around a deeper level API which itself is another wrapper around the Requests library ( which itself provides an abstraction that handles support for multiple HTTP backends, not all servers have curl, or the same versions of curl ). … Read more

wp_remote_post and form post

wp_remote_get returns a json string. You have different function to work with this json response. wp_remote_head() wp_remote_retrieve_body(), wp_remote_retrieve_header(), wp_remote_retrieve_headers(), wp_remote_retrieve_response_code(), wp_remote_retrieve_response_message() The example from the codex: $response = wp_remote_get( ‘http://www.example.com/index.html’ ); if( is_array($response) ) { $header = $response[‘headers’]; // array of http header lines $body = $response[‘body’]; // use the content } Depending on the … Read more

wp_remote_post rabobank omnikassa (version2) – error 5001

turns out (in case it’s helpful to someone else) that $omnikassaOrder[‘signature’] = hash_hmac(‘sha512’, json_encode(implode(‘,’,$toHash)), base64_decode($SigningKey)); should have been simply the following (without json_encode ) $omnikassaOrder[‘signature’] = hash_hmac(‘sha512’, implode(‘,’,$toHash), base64_decode($SigningKey));