Skip to content

Instantly share code, notes, and snippets.

View rrennick's full-sized avatar

Ron Rennick rrennick

  • https://automattic.com
  • Fredericton, New Brunswick, Canada
  • X @sillygrampy
View GitHub Profile
@rrennick
rrennick / gist:4651331
Last active July 11, 2016 21:04
Add global menu using network-wide-menu
<?php
/*
register the menu across the network
*/
register_nav_menu( 'global', 'Global Navigation Menu' );
/*
remove the menu from the menu screen on sub sites to avoid confusing users
*/
add_action( 'admin_init', 'global_nav_menu_init' );
@rrennick
rrennick / gist:5171259
Last active December 31, 2018 15:21
Linux/Mac command line for reverting file modification changes that have not been committed. Does not include removing files that were added to the repo.Originally posted at https://gist.github.com/anonymous/5171214 because I didn't know you had to re-login into the gist site when already logged into github.
for F in `git status | grep modified | cut -f4 -d' '` ; do git checkout -- $F ; done
@rrennick
rrennick / round.log
Created July 2, 2020 22:57
WooCommerce Round log
// Tax rate 1 was 8.5%
// Tax rate 2 between 3% and 10% on .5% increments
price: 10.10, rate 2: 9.00, wc tax: 1.84, round tax: 1.85
price: 10.20, rate 2: 3.50, wc tax: 1.25, round tax: 1.26
price: 10.30, rate 2: 3.00, wc tax: 1.21, round tax: 1.22
price: 10.40, rate 2: 3.50, wc tax: 1.28, round tax: 1.27
price: 10.50, rate 2: 4.50, wc tax: 1.41, round tax: 1.40
price: 10.80, rate 2: 5.00, wc tax: 1.50, round tax: 1.51
price: 10.90, rate 2: 7.00, wc tax: 1.75, round tax: 1.76
@rrennick
rrennick / fix-as-action-ids.php
Last active October 3, 2020 14:04
Address fatal error in Action Scheduler when identity field was not correctly set on migration
<?php
/*
Plugin Name: Fix Action Scheduler Action IDs
Version: 0.2
Author: Automattic
Author URI: https://automattic.com/
Description: This is a one time use plugin designed to address a fatal error during AS migration where the identity field in the actionscheduler_actions table did not get set before actions were migrated.
License: GNU General Public License v3.0 (or later)
License URI: http://www.opensource.org/licenses/gpl-license.php
@rrennick
rrennick / unicode.txt
Created December 13, 2023 20:21
Unicode characters in woocommerce/docs folder
.//reporting/extending-woocommerce-admin-reports.md
298:🎉 We can now view our Orders Report and see the currency reflected in monetary values throughout the report.
.//reporting/README.md
7:> ⚠️ **Notice:** This documentation is currently a **work in progress**. While it's open to the public for transparency and collaboration, please be aware that some sections might be incomplete or subject to change. We appreciate your patience and welcome any contributions!
.//payments/payment-gateway-plugin-base.md
5:This code can be used as a base to create your own simple custom payment gateway for WooCommerce. If not used in a custom plugin, you need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the [Code snippets](https://wordpress.org/plugins/code-snippets/) plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.
17: Copyright: © 2009-2011 WooThem