Skip to content

Instantly share code, notes, and snippets.

shawn boywondercreative

Block or report user

Report or block boywondercreative

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@boywondercreative
boywondercreative / box-shadow.html
Created May 23, 2019 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
View box-shadow.html
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
View flickity-carousel.php
@boywondercreative
boywondercreative / functions.php
Created Mar 13, 2019 — forked from xadapter/functions.php
Switch UPS account and origin address based on destination. wtih XAdapter UPS plugin WooCommerce UPS Shipping Plugin with Print Label
View functions.php
<?php
/**
* Snippet to Change UPS account based on destination country while confirming shipment (not while generating packages).
*
*/
add_filter( 'wf_ups_shipment_confirm_request_data', 'switch_origin_adress_based_on_country', 10, 2 );
if( ! function_exists('switch_origin_adress_based_on_country') )
{
@boywondercreative
boywondercreative / functions.php
Created Mar 13, 2019 — forked from xadapter/functions.php
How to change default shipping method programmatically.
View functions.php
function wf_default_shipping_method( $method ) {
$the_cheapest_cost = 1000000;
$packages = WC()->shipping()->get_packages()[0]['rates'];
foreach ( array_keys( $packages ) as $key ) {
if ( ( $packages[$key]->cost > 0 ) && ( $packages[$key]->cost < $the_cheapest_cost ) ) {
$the_cheapest_cost = $packages[$key]->cost;
$method_id = $packages[$key]->id;
}
}
@boywondercreative
boywondercreative / functions.php
Created Mar 13, 2019 — forked from varun-pluginhive/functions.php
Snippet to hide specified shipping methods with zero cost. PluginHive Plugins : https://www.pluginhive.com/plugins/
View functions.php
/**
* Snippet to hide specified shipping methods with zero cost.
* Created at : 07 Nov 2018
* Updated at : 07 Nov 2018
* PluginHive Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/a7b88d265b5ecb89d823ffe9d06daf7c
*/
add_filter( 'woocommerce_package_rates', function( $shipping_rates ){
$shipping_methods = array( 'wf_woocommerce_shipping_pro:1shipping-pro-1'); // Array of Shipping method ids
@boywondercreative
boywondercreative / functions.php
Created Mar 8, 2019 — forked from mikejolley/functions.php
WooCommerce - Split shipping class items into a new package and limit shipping methods
View functions.php
/**
* This function loops over cart items, and moves any item with shipping class 'special-class' into a new package.
* The new package in this example only takes flat rate shipping.
*/
function split_special_shipping_class_items( $packages ) {
$found_item = false;
$special_class = 'special-class'; // edit this with the slug of your shippig class
$new_package = current( $packages );
$new_package['contents'] = array();
$new_package['contents_cost'] = 0;
@boywondercreative
boywondercreative / import-ftp-proxy.php
Created Feb 2, 2019 — forked from m-thomson/import-ftp-proxy.php
This script reads the specified file over FTP and outputs it over HTTP. Thus, you can point WP ALL Import at the URL for this script on your server to provide a "bridge" between FTP and HTTP. This is provided with the hope it will be useful but custom PHP and importing over FTP is not officially supported.
View import-ftp-proxy.php
<?php
// Note: Anyone could access your data if they guess this URL. You should remove this file from the server
// after importing or name it to something "unguessable". For even better security use an .htaccess rule.
//
// If you're experiencing problems you can uncomment the following line so errors will be sent to the file.
// ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
//
// Enter the FTP (or HTTP) URL of your data file below.
$url = "ftp://username:password@hostname.com/full/path/to/file.csv";
View install-docker-elementary-loki.sh
#!/bin/bash
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo rm -f /etc/apt/sources.list.d/docker.list
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -u -cs) \
stable"
sudo apt-get update
sudo apt-get purge lxc-docker
@boywondercreative
boywondercreative / archive-product.php
Created Apr 2, 2018 — forked from yanknudtskov/archive-product.php
FacetWP Pagination for Enfold and WooCommerce #woocommerce #enfold
View archive-product.php
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive.
*
* Override this template by copying it to yourtheme/woocommerce/archive-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
@boywondercreative
boywondercreative / img-iframe-wysiwyg-wodpress-acf-prevent.php
Created Mar 7, 2018 — forked from KTPH/img-iframe-wysiwyg-wodpress-acf-prevent.php
Prevent Wordpress from wrapping images and iframes in p tags (default WYSIWYG and Advanced Custom Fields Wordpress WYSIWYG Plugin)
View img-iframe-wysiwyg-wodpress-acf-prevent.php
/**
*
* Prevent Wordpress from wrapping images and iframes in p tags
* http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/
* ( <p> and <iframe> and ACF support - http://wordpress.stackexchange.com/questions/136840/how-to-remove-p-tags-around-img-and-iframe-tags-in-the-acf-wysiwyg-field
*/
// Default Wordpress WYSIWYG
function filter_ptags_on_images_iframes($content)
{
$content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
You can’t perform that action at this time.