How does one make a URL return dynamic JSON with custom Content Type?

I asked this on stack overflow as well. You can find that answer here: https://stackoverflow.com/a/56801044/343292 I’ll copy and paste the answer below incase the link ever breaks. It worked for me. I used the dynamic way. ANSWER FROM @Sally CJ Note: I’m assuming WordPress is installed in the root folder. So if you want http://example.com/apple-app-site-association … Read more

Can’t access 3rd party API, code works on local server but not on wordpress

Can you drop this in and let us know what $content looks like? <?php $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, “A WORKING API”); $content = curl_exec($c); curl_close($c); echo ‘<pre>’; print_r($content); echo ‘</pre>’; I am curious if this is a WordPress issue or just a CORS issue with the call being made from a … Read more

Custom Post not Deleting on Uninstall

try with this : $args = array ( ‘post_type’ => ‘book’, ‘nopaging’ => true ); $myquery = new WP_Query ($args); while ($myquery->have_posts ()) { $myquery->the_post (); $id = get_the_ID (); wp_delete_post ($id, true); } wp_reset_postdata (); let me know if this works for you!