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
//Replace http with https in wp attachments | |
add_action( 'edited_product_cat', 'save_product_cat_banners', 10, 2 ); | |
function have_https_for_media( $url ) { | |
if ( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
} | |
add_filter( 'wp_get_attachment_url', 'have_https_for_media' ); |
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
$ext = end(explode(".", $data['FileManager']['file']['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
var dataContainer = document.getElementById('data-container'); | |
var observer = new MutationObserver(function (mutations) { | |
var table = mutations[0].target.getElementsByTagName("TABLE")[0]; | |
if (table != undefined) { | |
if (table.getElementsByTagName('tbody')[0].innerHTML.trim() == '') { | |
document.getElementById('upload-nsld').style.display = "none"; | |
} | |
else { | |
document.getElementById('upload-nsld').style.display = "inline-block"; |
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_filter( 'get_the_archive_title', function ($title) { | |
if ( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} elseif ( is_tag() ) { | |
$title = single_tag_title( '', false ); |
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 new_subcategory_hierarchy() { | |
$category = get_queried_object(); | |
$parent_id = $category->category_parent; | |
$templates = array(); | |
if ( $parent_id == 0 ) { | |
// Use default values from get_category_template() | |
$templates[] = "category-{$category->slug}.php"; |
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 | |
/* =Clean up the WordPress head | |
------------------------------------------------- */ | |
// remove header links | |
add_action('init', 'tjnz_head_cleanup'); | |
function tjnz_head_cleanup() { | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Category Feeds | |
remove_action( 'wp_head', 'feed_links', 2 ); // Post and Comment Feeds | |
remove_action( 'wp_head', 'rsd_link' ); // EditURI link |
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
jQuery(document).ready(function($){ | |
if (window.addEventListener) window.addEventListener('DOMMouseScroll', wheel, false); | |
window.onmousewheel = document.onmousewheel = wheel; | |
function wheel(event) { | |
var delta = 0; | |
if (event.wheelDelta) delta = event.wheelDelta / 120; | |
else if (event.detail) delta = -event.detail / 3; | |
handle(delta); |
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
/** | |
* Language Selector Shortcode | |
*/ | |
function qtranxf_generateLanguageSelectorShortcode() { | |
global $q_config; | |
if(is_404()) $url = get_option('home'); else $url = ''; | |
echo PHP_EOL.'<div style="text-transform: uppercase;" class="lang-sel sel-dropdown"><a href="#"><span>'.$q_config['language'].'</span></a><ul>'.PHP_EOL; | |
foreach(qtranxf_getSortedLanguages() as $language) { |
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
/* | |
* This is a JavaScript Scratchpad. | |
* | |
* Enter some JavaScript, then Right Click or choose from the Execute Menu: | |
* 1. Run to evaluate the selected text (Ctrl+R), | |
* 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or, | |
* 3. Display to insert the result in a comment after the selection. (Ctrl+L) | |
*/ | |
const __words = 150; |
OlderNewer