External api call using wordpress

Your curl request should work from the command line. Put you will want to use make it in a PHP file: $ch = curl_init(); $url = “https://api.com/”; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); http_build_query(array(‘postvar1’ => ‘value1’))); // Receive server response … curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $api_output = curl_exec($ch); curl_close($ch); Which php file you put the curl … Read more

How can I use React packages with the clasic editor?

I solved this by reading from the DOM. Not the prettiest way but it does what I needed. const CustomUpdateComponent = {…}; document.addEventListener(‘DOMContentLoaded’, () => { // replace update button with our own const publishingActionButton = document.querySelector( ‘#publishing-action’ ); if (publishingActionButton) { const postId = document.querySelector( ‘#post_ID’ ).value; render( <CustomUpdateComponent post={postId} … />, publishingActionButton ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)