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 | |
/** | |
* Pre-populate Woocommerce checkout fields | |
* Note that this filter populates shipping_ and billing_ fields with a different meta field eg 'first_name' | |
*/ | |
add_filter('woocommerce_checkout_get_value', function($input, $key ) { | |
global $current_user; | |
switch ($key) : |
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_action( 'init', function () { | |
wp_oembed_add_provider( '/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/.*/', 'http://fast.wistia.net/oembed', true ); | |
}); |
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
$('.play').click( function(event) { | |
if(event.preventDefault) { event.preventDefault(); } | |
$video = $(this).closest('iframe'); | |
if ( $video.hasClass('wistia_embed') ) { | |
window._wq = window._wq || []; | |
$video_id = /[^/]*$/.exec( $video.attr('src') )[0]; | |
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 | |
/** | |
* Place this part of code somewhere in functions.php | |
*/ | |
add_filter( 'posts_where' , function($q) { | |
global $wpdb; | |
$r = "AND ({$wpdb->posts}.post_password = '')"; | |
$q = str_replace($r, '', $q); |
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 | |
/** | |
* WooCommerce 3.0 gallery fix | |
*/ | |
add_action( 'after_setup_theme', function () { | |
add_theme_support( 'wc-product-gallery-zoom' ); | |
add_theme_support( 'wc-product-gallery-lightbox' ); | |
add_theme_support( 'wc-product-gallery-slider' ); | |
}); |
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 | |
/** | |
* Display errors | |
*/ | |
if ( ! function_exists('debug_wpmail') ) : | |
function debug_wpmail( $result = false ) { | |
if ( $result ) | |
return; |
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
const path = require('path'); | |
const config = require('./config'); | |
const webpack = require('webpack'); | |
const merge = require('webpack-merge'); | |
const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); |
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
const path = require('path'); | |
const config = require('./config'); | |
const webpack = require('webpack'); | |
const merge = require('webpack-merge'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); | |
const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
const hotMiddlewareScript = require('webpack-hot-middleware'); | |
/** |
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 if ( ! defined( 'ABSPATH' ) ) exit; | |
/** | |
* Filter Streaming videos products from JSON search in wp-admin 'Woocommerce orders' view | |
*/ | |
add_filter( 'woocommerce_json_search_found_products', function( $products ) { | |
/** | |
* Check HTTP Referer | |
*/ |
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 | |
/** | |
* Remove variouse template parts in WooCommerce | |
*/ | |
add_filter( 'wc_get_template', function( $located, $template_name, $args, $template_path, $default_path ) { | |
$remove = [ | |
'sale-flash.php', | |
'meta.php', |