Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
🙏
If we're kind and polite, the world will be right.

Luke Cavanagh lukecav

🙏
If we're kind and polite, the world will be right.
View GitHub Profile
[{"id":"1","options":"a:403:{s:4:\"type\";s:4:\"post\";s:21:\"is_override_post_type\";i:0;s:15:\"post_type_xpath\";s:0:\"\";s:8:\"deligate\";s:0:\"\";s:11:\"wizard_type\";s:3:\"new\";s:11:\"custom_type\";s:7:\"product\";s:14:\"featured_delim\";s:1:\",\";s:10:\"atch_delim\";s:1:\",\";s:25:\"is_search_existing_attach\";s:1:\"0\";s:15:\"post_taxonomies\";a:1:{s:11:\"product_cat\";s:154:\"[{\"item_id\":\"1\",\"left\":2,\"right\":5,\"parent_id\":null,\"xpath\":\"\",\"assign\":true},{\"item_id\":\"2\",\"left\":3,\"right\":4,\"parent_id\":\"1\",\"xpath\":\"\",\"assign\":true}]\";}s:6:\"parent\";i:0;s:23:\"is_multiple_page_parent\";s:3:\"yes\";s:18:\"single_page_parent\";s:0:\"\";s:5:\"order\";s:1:\"0\";s:6:\"status\";s:7:\"publish\";s:13:\"page_template\";s:7:\"default\";s:25:\"is_multiple_page_template\";s:3:\"yes\";s:20:\"single_page_template\";s:0:\"\";s:15:\"page_taxonomies\";a:0:{}s:9:\"date_type\";s:8:\"specific\";s:4:\"date\";s:3:\"now\";s:10:\"date_start\";s:3:\"now\";s:8:\"date_end\";s:3:\"now\";s:11:\"cust
@danielbachhuber
danielbachhuber / wpnps-auto-clear-sessions.php
Created September 15, 2020 12:11
Automatically clear WP Native PHP Sessions older than 24 hours
<?php
add_action(
'init',
function() {
if ( ! wp_next_scheduled( 'pantheonx_clear_sessions' ) ) {
wp_schedule_event( time(), 'twicedaily', 'pantheonx_clear_sessions' );
}
}
);
<?php
/**
* Plugin Name: WooCommerce Remove Admin Version Option
* Plugin URI: https://woocommerce.com
* Description: Adds a tool to the WooCommerce > Status > Tools page to remove the woocommerce_admin_version option
* Author: WooCommerce
* Domain Path: /languages
* Version: 0.1
*/
@jchristopher
jchristopher / searchwp-customizations.php
Created July 7, 2020 11:46
Add support for WooCommerce Admin filters when searching Orders with SearchWP
<?php
// Add support for WooCommerce Admin filters when searching Orders with SearchWP.
add_filter( 'searchwp\query\mods', function( $mods, $query ) {
global $wpdb;
if ( isset( $_GET['_customer_user'] ) && ! empty( $_GET['_customer_user'] ) ) {
$mod = new \SearchWP\Mod( \SearchWP\Utils::get_post_type_source_name( 'shop_order' ) );
$mod->set_local_table( $wpdb->postmeta );
$mod->on( 'post_id', [ 'column' => 'id' ] );
@stevegrunwell
stevegrunwell / limit-orders-forever.php
Created June 19, 2020 14:48
Add a "Forever" option to Limit Orders for WooCommerce - https://wordpress.org/support/topic/all-time-interval/
<?php
/**
* Plugin Name: Limit Orders for WooCommerce - Never-ending Interval
* Description: Add a "Forever" option to Limit Orders for WooCommerce.
* Author: Nexcess
* Author URI: https://nexcess.net
*/
/**
* Add "Forever" to the list of intervals.
@tamarazuk
tamarazuk / facebook-for-wc-disable-tracking-admin-purchases.php
Created June 12, 2020 02:59
facebook-for-wc-disable-tracking-admin-purchases.php
<?php // only copy this line if needed
add_action( 'init', function() {
if ( current_user_can( 'manage_options' ) && function_exists( 'facebook_for_woocommerce' ) && isset( facebook_for_woocommerce()->get_integration()->events_tracker ) ) {
$event_tracker = facebook_for_woocommerce()->get_integration()->events_tracker;
remove_action( 'woocommerce_thankyou', [ $event_tracker, 'inject_purchase_event' ], 40 );
remove_action( 'woocommerce_payment_complete', [ $event_tracker, 'inject_purchase_event' ], 40 );
@leandwo
leandwo / disable_yoast_meta_tags.php
Last active August 22, 2020 21:26
These are the hooks needed to disable or filter on yoast meta tags added to each page
<?php
add_filter( 'wpseo_json_ld_output', '__return_false' );
add_filter( 'wpseo_robots', '__return_false' );
add_filter( 'wpseo_canonical', '__return_false' );
add_filter( 'wpseo_title', '__return_false' );
add_filter( 'wpseo_metadesc', '__return_false' );
@ifyouwillit
ifyouwillit / templates_5ee149385d0c1.txt
Created June 10, 2020 20:58
WP All Import Templates for importing Products, Users, and Orders from GoDaddy Store
[{"id":"1","options":"a:403:{s:4:\"type\";s:4:\"post\";s:21:\"is_override_post_type\";i:0;s:15:\"post_type_xpath\";s:0:\"\";s:8:\"deligate\";s:0:\"\";s:11:\"wizard_type\";s:3:\"new\";s:11:\"custom_type\";s:7:\"product\";s:14:\"featured_delim\";s:1:\",\";s:10:\"atch_delim\";s:1:\",\";s:25:\"is_search_existing_attach\";s:1:\"0\";s:15:\"post_taxonomies\";a:1:{s:11:\"product_cat\";s:154:\"[{\"item_id\":\"1\",\"left\":2,\"right\":5,\"parent_id\":null,\"xpath\":\"\",\"assign\":true},{\"item_id\":\"2\",\"left\":3,\"right\":4,\"parent_id\":\"1\",\"xpath\":\"\",\"assign\":true}]\";}s:6:\"parent\";i:0;s:23:\"is_multiple_page_parent\";s:3:\"yes\";s:18:\"single_page_parent\";s:0:\"\";s:5:\"order\";s:1:\"0\";s:6:\"status\";s:7:\"publish\";s:13:\"page_template\";s:7:\"default\";s:25:\"is_multiple_page_template\";s:3:\"yes\";s:20:\"single_page_template\";s:0:\"\";s:15:\"page_taxonomies\";a:0:{}s:9:\"date_type\";s:8:\"specific\";s:4:\"date\";s:3:\"now\";s:10:\"date_start\";s:3:\"now\";s:8:\"date_end\";s:3:\"now\";s:11:\"cust
@stevegrunwell
stevegrunwell / limit-orders-15min.php
Created May 19, 2020 04:50
Add an "Every 15 minutes" option to Limit Orders for WooCommerce
<?php
/**
* Plugin Name: Limit Orders for WooCommerce - 15min Intervals
* Description: Add an "Every 15 minutes" option to Limit Orders for WooCommerce.
* Author: Nexcess
* Author URI: https://nexcess.net
*/
/**
* Add "Every 15min" to the list of intervals.
@jackdomleo7
jackdomleo7 / Useful_global_CSS.css
Last active March 14, 2025 07:22
A set of useful global CSS defaults to add to your site alongside a reset stylesheet (with explanations)
/*! NOTE: These are just recommended default global styles, edit as required */
@import ('Import reset stylesheet here, (I recommend modern-normalize) or even better, import the reset stylesheet in the HTML as the first imported stylesheet');
::selection { /* Optional */
/* It can be really hard to read highlighted text with a text-shadow, it should be removed when selected */
text-shadow: none;
/* NOTE: Using this means the color and background-color are set to transparent for selected text... */
/* So you can customise your styles below */