Skip to content

Instantly share code, notes, and snippets.

@mikejolley
mikejolley / functions.php
Last active November 8, 2022 00:25
WooCommerce 3.3 - Hide uncategorized category from the shop page on the frontend
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_product_subcategories_args' );
function custom_woocommerce_product_subcategories_args( $args ) {
$args['exclude'] = get_option( 'default_product_cat' );
return $args;
@mizner
mizner / wp_mail.md
Created January 14, 2018 19:21
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.8, and includes some upcoming changes in WordPress 4.9.

There are a few TODOs left. Please bear with me.

@spivurno
spivurno / gw-gravity-forms-coupons-allow-zero-amount-coupons.php
Created August 31, 2017 23:03
Gravity Wiz // Gravity Forms Coupons // Allow Zero Amount Coupons
<?php
/**
* Gravity Wiz // Gravity Forms Coupons // Allow Zero Amount Coupons
* http://gravitywiz.com/
*/
add_filter( 'gform_gravityformscoupons_feed_settings_fields', function( $settings ) {
foreach( $settings as &$group ) {
foreach( $group['fields'] as &$field ) {
if( $field['name'] == 'couponAmountType' ) {
@darinronne
darinronne / functions.php
Created May 30, 2017 14:11
ACF Confirm Row Deletion
// Confirm Deletion of an ACF Row
add_action('acf/input/admin_head', 'my_acf_confirm_row_deletion');
function my_acf_confirm_row_deletion() {
?>
<script type="text/javascript">
(function($) {
acf.add_action('ready', function(){
$('body').on('click', '[data-event="remove-row"]', function( e ){
return confirm("Delete row?");
});
<?php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty
@bryanwillis
bryanwillis / gravity-forms.scss
Created October 19, 2016 06:29
Gravity Forms SASS / SCSS
//--------------------------------------------------------------
// Gravity Forms
// Visit this link for CSS Targeting Examples - Very Helpful
// https://www.gravityhelp.com/documentation/article/css-targeting-examples/
//
// BASE STYLES
// FORM HEADER
// FORM FOOTER
// CONFIRMATION MESSAGE
// SELECTS
@spivurno
spivurno / gw-gravity-forms-advanced-conditional-logic.php
Last active June 5, 2024 15:38
Gravity Wiz // Gravity Forms // Advanced Conditional Logic
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Conditional Logic
*
* PLEASE NOTE: This snippet is a proof-of-concept. It is not supported and we have no plans to improve it.
*
* Allows multiple groups of conditional logic per field.
*
* @version 0.1
* @author David Smith <[email protected]>
@alokstha1
alokstha1 / install-wordpress-standard.txt
Created November 18, 2015 12:05
Install PHPCS with WordPress Coding Standard with Sublime Text 3
#optional part to install wordpress coding standards
git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs
# tell phpcs about the wordpress coding standards
cd ~/bin/phpcs
scripts/phpcs --config-set installed_paths ../wpcs
# we probably want to ignore the space indenting on the files
vim ~/bin/ruleset.xml
@getdave
getdave / strip-unwanted-gravity-forms-jquey-and-inline-scripts.php
Created November 12, 2015 12:14
Remove Gravity Forms jQuery and all inline <script> tags
/**
* Force GFORM Scripts inline next to Form Output
*
* force the script tags inline next to the form. This allows
* us to regex them out each time the form is rendered.
*
* see strip_inline_gform_scripts() function below
* which implements the required regex
*/
function force_gform_inline_scripts() {