This file contains hidden or 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 File Download. | |
* Usage: http://example.com/download.php?file=./uploads/image.jpg | |
* | |
* There are a couple of *ninja* exit() as security guarantee, adapt as necessary. | |
* | |
*/ | |
// Grab the requested file's name. |
This file contains hidden or 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
$(document).on('input', 'input, textarea', function () { | |
var $el = $(this), | |
val = $el.val(); | |
if (val.length) { | |
$el.css({direction: isRTL(val) ? 'rtl' : 'ltr'}); | |
} else { | |
$el.css({direction: ""}); | |
} | |
}); |
This file contains hidden or 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
http://jsfiddle.net/ianclark001/rkocah23/ |
This file contains hidden or 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
function get_custom_post_types_and_page_templates() { | |
global $wp_post_types; | |
// Public custom post types. | |
$args = [ | |
'public' => true, | |
'_builtin' => false, | |
]; | |
// Get the lists and add a suffix which denotes the type, Page or Post. |
This file contains hidden or 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
var queryString = {}; | |
location.search.substr(1).split("&").forEach(function (pair) { | |
if (pair.length) { | |
var parts = pair.split("="); | |
queryString[parts[0]] = decodeURIComponent(parts[1].replace(/\+/g, " ")); | |
} | |
}); | |
console.log(queryString); |
This file contains hidden or 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
if (history.pushState) { //IE10+ | |
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + decodeURIComponent(window.location.search); | |
window.history.pushState({path:newurl},'',newurl); | |
} |
This file contains hidden or 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
((general).*?(override)) |
This file contains hidden or 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
/** | |
* Wrap each letter of text in the given element in a span tag. | |
*/ | |
$.fn.lettering = function () { | |
this.each(function (index) { | |
var elem = $(this), | |
characters = elem.text().split(""); | |
elem.empty(); |
This file contains hidden or 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
<div class="c-forms w50"> | |
<div class="row no-gutters"> | |
<div class="col-md-6 col-xl-4 pad-by-location"> | |
<div> | |
<label> Full Name* [text* full_name placeholder "Full Name"] </label> | |
</div> | |
</div> | |
<div class="col-md-6 col-xl-4 pad-by-location"> | |
<div> | |
<label> Company Name* [text* company_name placeholder "Company Name"] </label> |
This file contains hidden or 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
/** | |
* Convert human readable strings to machine names. | |
* | |
* @param string $str | |
* The string to convert. | |
* | |
* @return string | |
* The converted string. | |
*/ | |
function machine_readable( $str ) { |
NewerOlder