Skip to content

Instantly share code, notes, and snippets.

View sirjonathan's full-sized avatar

Jonathan Wold sirjonathan

View GitHub Profile
@sirjonathan
sirjonathan / woolive-snippet-remove-sku
Created February 17, 2021 16:10
Remove SKU from product page
// Remove the "SKU" field on the product page
function woolive_remove_product_page_skus( $enabled ) {
// Check to make sure we're _not_ on the admin panel and that we _are_ on a product page
if ( ! is_admin() && is_product() ) {
// We're using a filter called wc_product_sku_enabled which, by default, has the SKU field enabled
// By returning false, we're telling it to disable the SKU field
return false;
}
@sirjonathan
sirjonathan / woolive-snippet-remove-coupon
Created February 17, 2021 16:09
Remove coupon form from checkout
// Removes the "Have a Coupon?" prompt from the checkout page
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
@sirjonathan
sirjonathan / gist:12743a7d6a38a68b63e2a23fa3788623
Created February 17, 2021 16:07
Remove coupon form from checkout
// Removes the "Have a Coupon?" prompt from the checkout page
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
@sirjonathan
sirjonathan / ABN
Created August 3, 2020 02:58
Add ABN to PDF Invoices
/**
* Add PDF invoice information meta
*
* @param array $info Invoice info meta.
* @param BEWPI_Invoice $invoice Invoice object.
* @since 2.9.8
*
* @return array.
*/
function add_invoice_information_meta( $info, $invoice ) {
### Keybase proof
I hereby claim:
* I am sirjonathan on github.
* I am sirjonathan (https://keybase.io/sirjonathan) on keybase.
* I have a public key whose fingerprint is 8BF8 9960 C7E7 B96A EE05 2FC1 F2B3 4EC7 4C0B A21B
To claim this, I am signing this object:
@sirjonathan
sirjonathan / 0_reuse_code.js
Created June 13, 2014 02:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sirjonathan
sirjonathan / new-wordpress-admin
Created November 4, 2012 20:27
Create New WordPress Admin Account
// Add to your active theme's functions.php
// Or, create a simple, must-use custom plugin:
// See: http://justintadlock.com/archives/2011/02/02/creating-a-custom-functions-plugin-for-end-users
function add_admin_acct(){
$login = 'Username';
$passw = 'examplepassword';
$email = 'youremailaddress';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
@sirjonathan
sirjonathan / gist:3779817
Created September 25, 2012 03:30
Feature Box CSS
#hgroup {
padding:45px 0 25px;
}
#feature-wrapper {
width:938px;
margin:0 auto;
padding:0 0 40px;
}
@sirjonathan
sirjonathan / gist:3779802
Created September 25, 2012 03:21
Feature Box Code
function hook_after_header() {
do_action('hook_after_header');
}
function feature_box() {
// First, set your conditions - When does it display?
if(is_home() || is_single() || is_page('offer') ) { ?>
<div id="feature-wrapper">
<div id="feature-offer">
@sirjonathan
sirjonathan / gist:3517622
Created August 29, 2012 19:31
Example Shortcode
[one_third] <h3>Service #1</h3>
A description of service one.
[/one_third] [one_third]
<h3>Service #2</h3>
A description of service two.
[/one_third] [one_third_last]