Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
🪨
Words of encouragement

Luke Cavanagh lukecav

🪨
Words of encouragement
View GitHub Profile
@lukecav
lukecav / sample_functions.php
Created October 5, 2016 15:51 — forked from growdev/sample_functions.php
Moving the location of the WooCommerce Variable Product Description on the product page
<?
/* Add this to your theme's functions.php to move the variation description display to a different location
* on the product page.
*/
add_action('plugins_loaded', 'move_variation_description', 50);
function move_variation_description(){
// Remove the hook from the original location
<?php
/**
* Plugin Name: WooCommerce Subscriptions Remove Deprecation Handlers
* Plugin URI: https://support.woothemes.com/hc/en-us/articles/205214466
* Description: Do not load backward compatibility support in Subscriptions 2.0.
* Author: Prospress Inc.
* Version: 1.0
* Author URI: http://prospress.com
*/
@lukecav
lukecav / wcs-calculate-next-payment-from-last-payment.php
Created October 5, 2016 22:11 — forked from thenbrent/wcs-calculate-next-payment-from-last-payment.md
By default, WooCommerce Subscriptions will calculate the next payment date for a subscription from the time of the last payment. This plugin changes that to preserve the original schedule and calculate the next payment date from the scheduled payment date, not the time the payment was actually processed. For example, without this plugin, the due…
<?php
/**
* Plugin Name: WooCommerce Subscriptions - Preserve Billing Schedule
* Plugin URI:
* Description: By default, WooCommerce Subscriptions will calculate the next payment date for a subscription from the time of the last payment. This plugin changes it to preserve the original schedule and calculate the next payment date from the scheduled payment date, not the time the payment was actually processed.
* Author: Prospress Inc.
* Author URI: http://prospress.com/
* Version: 1.0
*
* Copyright 2016 Prospress, Inc. (email : [email protected])
@lukecav
lukecav / wcs-mod-display.php
Created October 5, 2016 22:11 — forked from thenbrent/wcs-mod-display.php
Prepend "With Failure" to subscriptions with the "on-hold" status and the last renewal order with the "failed" status.
<?php
/**
* Plugin Name: WooCommerce Subscriptions - Display Failed Status
* Plugin URI:
* Description: Prepend "With Failure" to subscriptions with the "on-hold" status and the last renewal order with the "failed" status.
* Author: Prospress Inc.
* Author URI: http://prospress.com/
* Version: 1.0
*
* Copyright 2016 Prospress, Inc. (email : [email protected])
@lukecav
lukecav / remove-meta.php
Created October 6, 2016 01:56 — forked from neilgee/remove-meta.php
Remove Genesis Theme Settings Metaboxes
<?php
add_action( 'genesis_admin_before_metaboxes', 'wpb_remove_unwanted_genesis_metaboxes' );
/**
* Remove various metaboxes of Genesis Theme Settings
* More metaboxes appear see @filesource genesis/admin/theme-settings.php
* @param metaboxes()
* @see https://fewerthanthree.com/code-snippets/remove-blog-page-settings-genesis-theme-settings/
*
*/
@lukecav
lukecav / password-validation.php
Created October 6, 2016 01:59 — forked from neilgee/password-validation.php
WooCommerce Confirm Password
<?php
// place the following code in your theme's functions.php file
// Add a second password field to the checkout page.
add_action( 'woocommerce_checkout_init', 'wc_add_confirm_password_checkout', 10, 1 );
function wc_add_confirm_password_checkout( $checkout ) {
if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) {
$checkout->checkout_fields['account']['account_password2'] = array(
'type' => 'password',
@lukecav
lukecav / functions.php
Created October 6, 2016 01:59 — forked from WPprodigy/functions.php
Remove the password strength meter from WooCommerce checkout
function wc_ninja_remove_password_strength() {
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
wp_dequeue_script( 'wc-password-strength-meter' );
}
}
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 );
@lukecav
lukecav / custom-logo.php
Created October 6, 2016 02:00 — forked from neilgee/custom-logo.php
Using Custom Logo with Genesis via Customizer
<?php
add_theme_support( 'custom-logo', array(
'height' => 240, // set to your dimensions
'width' => 240,
'flex-height' => true,
'flex-width' => true,
) );
@lukecav
lukecav / woo-prod-description.php
Created October 6, 2016 02:03 — forked from neilgee/woo-prod-description.php
WooCommerce Move Product Description Above Product
<?php //<~ don't add me in
add_action( 'woocommerce_before_single_product', 'themeprefix_woocommerce_template_product_description', 20 );
/**
* Add product description above product
* Output description tab template using 'woocommerce_before_single_product' hook
*/
function themeprefix_woocommerce_template_product_description() {
wc_get_template( 'single-product/tabs/description.php' );