Skip to content

Instantly share code, notes, and snippets.

Avatar

Bryan Hoffman spigotdesign

View GitHub Profile
View article-list
$args = [
'post_type' => 'ht_kb',
'tax_query' => [
[
'taxonomy' => 'ht_kb_category',
'terms' => $hkb_current_term_id,
],
],
'posts_per_page' => 5,
'orderby' => 'term_id',
View woo-sub-fatal-error
2022-08-02T00:05:22+00:00 CRITICAL Uncaught Error: Call to a member function get_data_store() on bool in /home/cinchws/public_html/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-initial-cart-stock-manager.php:85
Stack trace:
#0 /home/cinchws/public_html/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-initial-cart-stock-manager.php(45): WCS_Initial_Cart_Stock_Manager::has_handled_stock(false)
#1 /home/cinchws/public_html/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-renewal-cart-stock-manager.php(49): WCS_Initial_Cart_Stock_Manager::get_order_from_cart()
#2 /home/cinchws/public_html/wp-includes/class-wp-hook.php(307): WCS_Renewal_Cart_Stock_Manager::maybe_adjust_stock_checkout('')
#3 /home/cinchws/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
#4 /home/cinchws/public_html/wp-includes/plugin.php(476): WP_Hook->do_a
View gist:220f7150b959afcf53494dfbe98fac1d
<style>
.rootrez_widget_form_wrapper {
border-radius: 0;
border: none;
}
#rootrez-widget-form .search_dates,
#rootrez-widget-form .search_occupancy {
flex-basis: 100% !important;
border: 2px solid gray;
margin-bottom: 10px;
View spigot-walker.php
class Spigot_Walker extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth=0, $args=array(), $id = 0) {
$object = $item->object;
$type = $item->type;
$title = $item->title;
$permalink = $item->url;
$classes = $item->classes;
$output .= "<li id='menu-item-". $item->ID ."' class='menu__item " . implode(" ", $classes) . "'>";
View event feed
<?php $event_feed = new WP_Query(
array(
'post_type' => 'tribe_events',
'posts_per_page' => $settings->post_items ,
'eventDisplay' => 'upcoming',
'start_date' => $current_date,
'end_date' => $current_date,
'orderby' => 'start_date',
'order' => 'ASC',
View TSF output
// 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/" />
View Event Calendar Pro feed
<?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(
View product-revision-support.php
/*
* 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';
@spigotdesign
spigotdesign / reply-to-order-filter.php
Created Dec 29, 2018
Filter New Order email headers for WooCommerce
View reply-to-order-filter.php
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();
View woo-enable-reviews-bulk-edit.php
<?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
*