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
<?php | |
/** | |
* Force WP JSON REST API endpoints to always be served over HTTPS | |
* | |
* @action wp_json_server_before_serve | |
* | |
* @return void | |
*/ | |
function fjarrett_wp_json_force_ssl() { |
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
<?php | |
function send_http_auth_headers(){ | |
header('WWW-Authenticate: Basic realm="Your Website Name Restricted"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo 'Please speak to an administrator for access to the this feature.'; | |
exit; | |
} | |
add_action('template_redirect', 'maybe_add_http_auth_basic', 0); | |
function maybe_add_http_auth_basic(){ | |
# Add your specific URI segment (i.e. http://example.com/segment-string/) |
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
/* | |
Add image by link plugin for Imperavi Redactor v10.x.x | |
Updated: January 21, 2015 | |
Copyright (c) 2015, Alexey Kinev | |
License: The MIT License (MIT) http://opensource.org/licenses/MIT | |
Usage: | |
$('#redactor').redactor({ | |
imageUpload: false, |
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
app.directive('dynamicHeight', function() { | |
return { | |
require: ['^ionSlideBox'], | |
link: function(scope, elem, attrs, slider) { | |
scope.$watch(function() { | |
return slider[0].__slider.selected(); | |
}, function(val) { | |
//getting the heigh of the container that has the height of the viewport | |
var newHeight = window.getComputedStyle(elem.parent()[0], null).getPropertyValue("height"); | |
if (newHeight) { |
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
<?php | |
// apitest.php | |
// by Karl Kranich - karl.kranich.org | |
// version 3.1 - edited query section | |
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php'); | |
include_once "google-api-php-client/examples/templates/base.php"; | |
$client = new Google_Client(); |
OlderNewer