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 | |
/* Forked from : https://gist.github.com/yoanmarchal/4030827 */ | |
/** | |
* Given a string containing any combination of YouTube and Vimeo video URLs in | |
* a variety of formats (iframe, shortened, etc), each separated by a line break, | |
* parse the video string and determine it's valid embeddable URL for usage in | |
* popular JavaScript lightbox plugins. | |
* | |
* In addition, this handler grabs both the maximize size and thumbnail versions |
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 | |
/* WooCommerce prices shown with or without tax depending on client type */ | |
add_filter( 'option_woocommerce_tax_display_shop', 'woocommerce_show_prices_with_or_without_tax' ); | |
add_filter( 'option_woocommerce_tax_display_cart', 'woocommerce_show_prices_with_or_without_tax' ); | |
function woocommerce_show_prices_with_or_without_tax( $option ) { | |
if ( is_user_logged_in() ) { | |
//Client type from user_meta or profile or whatever... | |
//Example: $client_hide_tax = get_user_meta( get_current_user_id(), 'client_type', true ) ? true : false; | |
//Example to create this field on registration: https://gist.github.com/webdados/c8dbbe7ccdea3463312e5b865ad92d92 |
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 | |
class WP_HTML_Compression | |
{ | |
// Settings | |
protected $compress_css = true; | |
protected $compress_js = true; | |
protected $info_comment = true; | |
protected $remove_comments = true; | |
// Variables |
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 | |
/** | |
* Repeatable Custom Fields in a Metabox with Image upload | |
* Drag and Drop option | |
* Modified by: ashokmhrj | |
* Extracted from: Helen Hou-Sandi | |
*/ | |
define('PATH_TO_JS','define path here'); | |
function ask_admin_repeater_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
<?php | |
/** | |
* Subscribe User to MailChimp | |
*/ | |
function woo_mailchimp_subscribe_user($order_id,$posted){ | |
if(!empty($_POST['wooms_susbscribe']) && $_POST['wooms_susbscribe'] == '1'){ | |
try{ | |
$email = $posted['billing_email']; | |
$merge_vars = array('FNAME' => $posted['billing_first_name'],'LNAME' => $posted['billing_last_name']); |
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 | |
/** | |
* Wordpress pagination | |
* paginate_links | |
* https://codex.wordpress.org/Function_Reference/paginate_links | |
*/ | |
function wp_pagination($echo = true) { | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer |