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
/** | |
* Handle conditional field logic | |
*/ | |
$('[data-conditional-switch]').css('display', 'none'); | |
updateConditionalFields(); | |
function updateConditionalFields() { | |
$('[data-conditional-control]').each(function () { | |
var conditional_value = ''; | |
var conditional_switch = $(this).attr('name'); | |
if ($(this).attr('type') == 'radio') { |
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
/* ========================================================================= | |
* GENERATE 301s | |
* ========================================================================= | |
*/ | |
function checkForMatch($old_url, $is_attachment=false) { | |
if (!$is_attachment) { | |
$meta_key = 'old_url'; | |
$post_type = 'page'; | |
} else { |
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 setupFootable( footable ) { | |
footable.on('expand.ft.row', function(e, ft, row) { | |
row.$el.find('.toggle i').removeClass('ion-md-add').addClass('ion-md-remove'); | |
}); | |
footable.on('collapse.ft.row', function(e, ft, row) { | |
row.$el.find('.toggle i').removeClass('ion-md-remove').addClass('ion-md-add'); | |
}); |
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 getNodesThatContain(text) { | |
var textNodes = $('#page').find(':not(iframe, script)') | |
.contents().filter( | |
function () { | |
return (this.nodeType == 3 && this.textContent.indexOf(text) > -1); | |
}); | |
return textNodes.parent(); | |
} | |
function forceTextNodeCase(proper_text) { | |
var nodes = getNodesThatContain(proper_text).each(function () { |
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
/** | |
* Generates the label array for use in creating WP taxonomies. Takes a singular | |
* root as well as an optional plural form; if the plural is not supplied, then | |
* a root+'s' will be used instead. | |
*/ | |
function generate_taxonomy_labels($singular, $plural=false) { | |
if ( !$plural ) { | |
$plural = $singular . 's'; | |
} | |
return array( |
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
/** | |
* Add external link CSS to the head | |
*/ | |
function external_link_css() { | |
echo ' | |
<style> | |
a:after { | |
content: "\e9a7"; | |
margin-left: .3em; | |
font-size: .8em; |