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
// check that cart items quantities totals are in multiples of 5 | |
add_action( 'woocommerce_check_cart_items', 'woocommerce_check_cart_quantities' ); | |
function woocommerce_check_cart_quantities() { | |
global $woocommerce; | |
$multiples = 5; | |
$total_products = 0; | |
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) { | |
$total_products += $values['quantity']; | |
} | |
if ( ( $total_products % $multiples ) > 0 ) |
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
.flex_column { | |
position: relative; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
background-color: rgba(0,0,0,0.0); | |
box-shadow: 0 1px 5px rgba(0,0,0,0.25), 0 0 50px rgba(0,0,0,0.1) inset; | |
border: 2px solid #6640FF; | |
/*border-radius: 1% 1% 1% 1% / 1% 1% 1% 1%;*/ |
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
<script type="text/javascript"> | |
jQuery('document').ready(function($){ | |
$('[title]').removeAttr('title'); | |
}); | |
</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
if(!function_exists('avia_backend_safe_string')) | |
{ | |
/** | |
* Create a lower case version of a string without spaces so we can use that string for database settings | |
* | |
* @param string $string to convert | |
* @return string the converted string | |
*/ | |
function avia_backend_safe_string( $string , $replace = "_") |
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
// used for $current_home = 'current'; | |
$group1 = array( | |
'home' => True, | |
); | |
// used for $current_users = 'current'; | |
$group2 = array( | |
'users.online' => True, | |
'users.location' => True, | |
'users.featured' => True, |
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 | |
// This code is a serialised string fixer for WordPress (and probably other systems). | |
// Simply select the table you need to fix in $table, and the code will change the string lengths for you. Saves having to manually go through. | |
// Written 20090302 by David Coveney http://www.davecoveney.com and released under the WTFPL - ie, do what ever you want with the code, and I take no responsibility for it OK? | |
// To view the WTFPL go to http://sam.zoy.org/wtfpl/ (WARNING: it's a little rude, if you're sensitive) | |
// | |
// Thanks go to getmequick at gmail dot com who years ago posted up his preg_replace at http://uk2.php.net/unserialize and saved me trying to work it out. | |
// | |
// Before you start, do make a backup. A backup that you know works, because this code has the scope to really break your data if you're careless. |
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 | |
/* | |
Plugin Name: Remove All Feeds [for WPSE33072] | |
Description: Remove all feeds from WordPress | |
Author: Christopher Davis | |
Author URI: http://christopherdavis.me | |
License: GPL2 | |
*/ | |
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_action( 'wp_scheduled_delete', 'delete_expired_db_transients' ); | |
function delete_expired_db_transients() { | |
global $wpdb, $_wp_using_ext_object_cache; | |
if( $_wp_using_ext_object_cache ) | |
return; | |
$time = isset ( $_SERVER['REQUEST_TIME'] ) ? (int)$_SERVER['REQUEST_TIME'] : 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
$(document).ajaxComplete(function(){ | |
try{ | |
FB.XFBML.parse(); | |
}catch(ex){} | |
}); | |
//ref: http://stackoverflow.com/questions/3548493/how-to-detect-when-facebooks-fb-init-is-complete |