Skip to content

Instantly share code, notes, and snippets.

View spigotdesign's full-sized avatar

Bryan Hoffman spigotdesign

View GitHub Profile
/*
* Add Revision support to WooCommerce Products
*
*/
add_filter( 'woocommerce_register_post_type_product', 'cinch_add_revision_support' );
function cinch_add_revision_support( $supports ) {
$supports['supports'][] = 'revisions';
// Output on Single Post
<meta name="description" content="Most of us who are close to the WordPress world know that Gutenberg is coming. And probably soon. We’ve been using it here on Cinch and elsewhere in order to…" />
<meta property="og:image" content="https://cinchws.local/wp-content/uploads/2018/09/marco-djallo-127113-unsplash.jpg" />
<meta property="og:image:width" content="1300" />
<meta property="og:image:height" content="450" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="og:title" content="This is the test meta title yes! | Cinch Web Services" />
<meta property="og:description" content="Most of us who are close to the WordPress world know that Gutenberg is coming. And probably soon. We’ve been using it here on Cinch and elsewhere in order to get a better understanding of how it works…" />
<meta property="og:url" content="https://cinchws.local/keeping-up-with-gutenberg/" />
<?php $efeed = new WP_Query( array(
'post_type' => 'tribe_events',
'showposts' => 2,
'eventDisplay' => 'upcoming',
'start_date' => $current_date,
'end_date' => $current_date,
'orderby' => 'start_date',
'order' => 'ASC',
'tax_query' => array(
array(
.flood .service:nth-of-type(1) {
#redSwatch {
@include animation-name(red-swatch-go);
@extend .animation-settings;
@include transform-origin(32%, 78%);
}
&:hover #redSwatch {
@include animation-name(red-swatch-off);
@spigotdesign
spigotdesign / ecp-widget.php
Last active September 11, 2019 13:40
Events Calendar Pro event
<?php $efeed = new WP_Query( array(
'post_type' => 'tribe_events',
'showposts' => 2,
'eventDisplay' => 'upcoming',
'start_date' => $current_date,
'end_date' => $current_date,
'orderby' => 'start_date',
'order' => 'ASC',
'tax_query' => array(
array(
@spigotdesign
spigotdesign / reply-to-order-filter.php
Created December 29, 2018 17:04
Filter New Order email headers for WooCommerce
add_filter('woocommerce_email_header', 'spigot_reply_to_mail_filter', 11, 3);
function spigot_reply_to_mail_filter($headers = '', $ordertype = 'new_order', $order = '') {
if(!is_object($order) || empty($order) || $ordertype !== 'new_order') { return $headers; }
$name = $order->get_billing_first_name().' '.$order->get_billing_last_name();
$email = $order->get_billing_email();
@spigotdesign
spigotdesign / woo-enable-reviews-bulk-edit.php
Created November 20, 2018 18:52 — forked from mariovalney/woo-enable-reviews-bulk-edit.php
WooCommerce Enable Reviews - Bulk Edit
<?php
/**
*
* Plugin Name: WooCommerce Enable Reviews - Bulk Edit
* Description: Allow enable reviews by bulk edit into WooCommerce
* Version: 1.0.0
* Author: Mário Valney
* Author URI: http://mariovalney.com
* Text Domain: woo-enable-reviews-bulk-edit
*
<svg class="icon icon--twitter"><use xlink:href="#icon--twitter"></use></svg>
@spigotdesign
spigotdesign / hide-title.js
Created July 10, 2018 23:34
Hide title attribute on hover, but don't remove
$(".element").hover(function(){
// Get the current title
var title = $(this).attr("title");
// Store it in a temporary attribute
$(this).attr("tmp_title", title);
// Set the title to nothing so we don't see the tooltips
$(this).attr("title","");
@spigotdesign
spigotdesign / hide-zero-value.php
Last active June 26, 2018 17:17
Hide zero value on WooCommerce free shipping methods
/*
* Hide zero value on any zero cost shipping methods
*
*/
add_filter( 'woocommerce_cart_shipping_method_full_label', function( $label, $method ) {
if ( $method->cost <= 0 ) {
$label = $method->get_label();