This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Make a WordPress site inaccessible except via a secret | |
* parameter in the URL. Once that URL is visited, | |
* grant the visitor access for a number of days via a cookie. | |
* | |
* Gateway URL is of the form: example.com/?{{ secret }} | |
*/ | |
add_action('init', 'secret_gateway_only_access'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function( $ ) { | |
$('#s').autocomplete({ | |
serviceUrl: '/wp-admin/admin-ajax.php?action=autocompleteCallback', | |
dataType: 'json', | |
paramName: 'term', | |
transformResult: function(response) { | |
return { | |
suggestions: $.map(response.results, function(dataItem) { | |
return { value: dataItem.title, data: dataItem.url }; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |