Skip to content

Instantly share code, notes, and snippets.

<?php
/* place in theme's functions.php file */
/* disable json api if api key not correct */
add_action('init','json_api_apikey_check' , 1 );
function json_api_apikey_check()
{
$api_key = 'hello';
$base = get_option('json_api_base', 'api');
$this_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";