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
// Force the native sale-price overwrite | |
add_filter( 'get_post_metadata', 'wcssm_markus_filter_sale_price_meta', 11, 4 ); | |
function wcssm_markus_filter_sale_price_meta( $value, $object_id, $meta_key, $single ) { | |
if ( $meta_key === '_sale_price' ) { | |
remove_filter( 'get_post_metadata', 'wcssm_markus_filter_sale_price_meta', 11, 4 ); | |
if ( $sale = WCSSM::get_applicable_sale( $object_id ) ) { | |
$value = $sale['price']; |
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
// Force the native sale-price-end-date overwrite | |
add_filter( 'get_post_metadata', 'wcssm_woodmart_filter_sale_price_meta', 11, 4 ); | |
function wcssm_woodmart_filter_sale_price_meta( $value, $object_id, $meta_key, $single ) { | |
if ( $meta_key === '_sale_price_dates_to' ) { | |
remove_filter( 'get_post_metadata', 'wcssm_woodmart_filter_sale_price_meta', 11, 4 ); | |
if ( $sale = WCSSM::get_applicable_sale( $object_id ) ) { | |
$schedule = array_shift( $sale['schedule'] ); |
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_filter( 'clientside-is-themed', function( $bool ) { | |
if ( $_GET['page'] === 'my-admin-page' ) { | |
$bool = false; | |
} | |
return $bool; | |
} ); |
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_filter( 'wcssm-applicable-sales', function( $value, $product ) { | |
if ( ! $product->is_in_stock() ) { | |
$value = null; | |
} | |
return $value; | |
}, 10, 2 ); |
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
// Scheduled Sale Manager for WooCommerce support for Currency Switcher for WooCommerce by RealMag777 | |
// Prevents incorrect sale price when the "Advanced > Is multiple allowed" option is enabled. | |
if ( class_exists( 'WOOCS' ) ) { | |
global $WOOCS; | |
add_filter( 'woocommerce_product_get_price', function( $price, $product_object ) { | |
global $WOOCS; | |
$is_manual_sale = $product_object->get_sale_price( 'edit' ) && $product_object->get_sale_price( 'edit' ) == WCSSM::get_product_sale_price( $product_object->get_sale_price( 'edit' ), $product_object ); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Etalage - Fancybox as a gallery example</title> | |
<link rel="stylesheet" href="css/etalage.css"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.min.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="js/jquery.etalage.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.pack.min.js"></script> |
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
// Tell WP everything is up to date | |
add_filter( 'pre_site_transient_update_core', 'le_prevent_update_checks' ); | |
add_filter( 'pre_site_transient_update_plugins', 'le_prevent_update_checks' ); | |
add_filter( 'pre_site_transient_update_themes', 'le_prevent_update_checks' ); | |
function le_prevent_update_checks() { | |
global $wp_version; | |
return (object) array( | |
'last_checked' => time(), |
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
/* Source: http://css-tricks.com/snippets/sass/maintain-aspect-ratio-mixin/ */ | |
@mixin aspect-ratio($width, $height) { | |
position: relative; | |
&:before { | |
display: block; | |
content: ""; | |
width: 100%; | |
padding-top: ($height / $width) * 100%; | |
} |
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
<!--[if lte IE 6]><html class="ie ie6 lte9 lte8 lte7"><![endif]--> | |
<!--[if IE 7]><html class="ie ie7 lte9 lte8 lte7"><![endif]--> | |
<!--[if IE 8]><html class="ie ie8 lte9 lte8"><![endif]--> | |
<!--[if IE 9]><html class="ie ie9 lte9"><![endif]--> | |
<!--[if gt IE 9]><html><![endif]--> | |
<!--[if !IE]><!--><html><!--<![endif]--> |
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
var tabbableElements = 'a[href], area[href], input:not([disabled]),' + | |
'select:not([disabled]), textarea:not([disabled]),' + | |
'button:not([disabled]), iframe, object, embed, *[tabindex],' + | |
'*[contenteditable]'; | |
function keepFocus($context){ | |
var $allTabbableElements = $context.find(tabbableElements); | |
var $firstTabbableElement = $allTabbableElements.first(); | |
var $lastTabbableElement = $allTabbableElements.last(); | |
$context.on('keydown', function(event){ |
NewerOlder