Skip to content

Instantly share code, notes, and snippets.

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

Luke Cavanagh lukecav

🪨
Words of GREAT encouragement!
View GitHub Profile
@lukecav
lukecav / remove-woocommerce-submenu-items
Created October 21, 2016 15:40 — forked from WillBrubaker/remove-woocommerce-submenu-items
Remove WooCommerce submenu items for Shop Managers
<?php
/*
Don't copy the opening php tag
*/
/*
Removes submenu items from WooCommerce menu for 'Shop Managers'
available submenu slugs are:
wc-addons - the Add-ons submenu
wc-status - the System Status submenu
@lukecav
lukecav / functions.php
Created October 24, 2016 02:39 — forked from frankschrijvers/functions.php
Change add to cart button text per category
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text per category
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wps_custom_cart_button_text' );
function wps_custom_cart_button_text() {
global $product;
$terms = get_the_terms( $product->ID, 'product_cat' );
foreach ($terms as $term) {
@lukecav
lukecav / functions.php
Created October 24, 2016 02:41 — forked from frankschrijvers/functions.php
How to hide trailing zeros on prices in WooCommerce
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Hide trailing zeros on prices.
add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 );
function wc_hide_trailing_zeros( $trim ) {
return true;
}
@lukecav
lukecav / graphite.md
Created November 22, 2016 20:48 — forked from albertohm/graphite.md
Install and configure graphite on ubuntu

Install python-pip

sudo apt-get install python-pip libcairo2 python-cairo

Install Graphite and Dependencies

pip install carbon
pip install whisper
pip install django
pip install django-tagging
pip install graphite-web
<?php
// DISABLE CERTAIN FIELDS
function enqueue_gf_disable() {
wp_enqueue_script( 'gf-disable', plugins_url( '/scripts/gravity-forms-disable.js', dirname(__FILE__) ) );
}
add_action( 'wp_enqueue_scripts', 'enqueue_gf_disable' );
@lukecav
lukecav / .htaccess
Created January 3, 2017 18:57 — forked from Zodiac1978/.htaccess
Make WordPress faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
#
@lukecav
lukecav / wp-privacy.php
Created January 10, 2017 20:02 — forked from mattyrob/wp-privacy.php
Stop WordPress auto-updates and control information shared with api.wordpress.org
<?php
// you'll have to put a plugin header here
// Stop auto updated in WordPress 3.7+
add_filter( 'auto_update_core', '__return_false' );
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );
add_filter( 'auto_update_translation', '__return_false' );
// stop translation updates when updating plugins or themes
@lukecav
lukecav / capital-c-dangit.php
Created February 2, 2017 19:47 — forked from glueckpress/capital-c-dangit.php
[WordPress] Forever eliminate “Wordcamp” from the planet (or at least the little bit we can influence).
<?php
/**
* Plugin Name: Capital C, dangit!
* Description: Forever eliminate “Wordcamp” from the planet (or at least the little bit we can influence).
* Version: 2015.12
* Author: Caspar Hübinger
* Author URI: https://profiles.wordpress.org/glueckpress
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
/* Woocommerce Styles */
.woocommerce-message { display: none; }
.woocommerce-cart.full-width-content .content,
.woocommerce-checkout.full-width-content .content { max-width: 100%; }
.woocommerce-cart .woocommerce table.shop_table td.actions {
border-top: 1px solid #e6e6e6;
background: #f7f7f7;
border-bottom: 0px solid #e6e6e6;
@lukecav
lukecav / gw-gravity-forms-prevent-duplicate-submissions.php
Created February 13, 2017 20:44 — forked from spivurno/gw-gravity-forms-prevent-duplicate-submissions.php
Gravity Wiz // Gravity Forms // Prevent Duplicate Submissions from Double Clicks
</php
/**
* Gravity Wiz // Gravity Forms // Prevent Duplicate Submissions from Double Clicks
* http://gravitywiz.com/
*/
add_filter( 'gform_pre_render', 'gw_disable_submit' );
function gw_disable_submit( $form ) {
if( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return $form;