Skip to content

Instantly share code, notes, and snippets.

View deckerweb's full-sized avatar
🏠
Working from home

David Decker deckerweb

🏠
Working from home
View GitHub Profile
@deckerweb
deckerweb / dlm-pa-search-args.php
Created May 13, 2015 08:39
Download Monitor - tweak search args for Page Add-On --- status here: testing - don't use yet!!! ;-)
<?php
add_filter( 'dlm_page_addon_search_query_args', 'ddw_dlm_search_args' );
/**
* Plugin: Download Monitor
* Tweak Downloads search args
*/
function ddw_dlm_search_args( $args ) {
$args[ 'tax_query' ] = array(
<?php
/*
* Add custom query vars to handle Google Analytics Ecommerce tracking.
* This should be placed in a plugin or in functions.php of the theme.
*
* You'll want to use the redirect method for Gravity Forms confirmations and
* turn on passing field data via a query string. An example we used was:
* donation_amount={Donation Amount:13}&donation_id={entry_id}&donation_recurring=0
*/
function sm_add_query_vars( $vars ){
<?php
/*
* @goliver79
* woocommerce hide empty categories in woocommerce widget "product categories"
*/
function woo_hide_product_categories_widget( $list_args ){
$list_args[ 'hide_empty' ] = 1;
return $list_args;
}
@deckerweb
deckerweb / cpi-snippets.php
Last active August 29, 2015 14:07
Cleaner Plugin Installer plugin v1.0.0 or higher -- helper functions, plus actions, filters for customizing etc.
<?php
/** Do NOT include the opening php tag */
/**
* Plugin: Cleaner Plugin Installer - activate Slim Mode.
*/
if ( ! defined( 'CPI_SLIM_MODE' ) ) {
define( 'CPI_SLIM_MODE', TRUE );
}
@deckerweb
deckerweb / text-widget-shortcodes.php
Last active August 29, 2015 14:07
Enable Shortcode for Text Widgets in WordPress.
<?php
/** Do NOT include the opening php tag */
add_action( 'init', 'ddw_add_shortcodes_for_text_widget', 1 );
/**
* Enable Shortcodes for Text Widgets.
*
* @author David Decker - DECKERWEB
@deckerweb
deckerweb / gist:b7e70a52ed76b6486795
Last active August 8, 2021 02:39
WordPress Forms plugin comparison table - by David Decker (@deckerweb) of deckerweb.de
/**
* to exclude field from notification add 'exclude[ID]' option to {all_fields} tag
* 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification
* see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options
* example: {all_fields:exclude[2,3]}
* example: {all_fields:include[6]}
* example: {all_fields:include[6],exclude[2,3]}
*/
add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 );
function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) {
<?php
/**
* Dont Update the Theme
*
* If there is a theme in the repo with the same name, this prevents WP from prompting an update.
*
* @since 1.0.0
* @param array $r Existing request arguments
* @param string $url Request URL
* @return array Amended request arguments
@deckerweb
deckerweb / wc-custom-add-to-cart-texts.php
Created June 3, 2014 14:22
Custom text for 'woocommerce_product_add_to_cart_text' filter for all product types/ cases.
<?php
/** Do NOT include the opening php tag */
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/**
* Custom text for 'woocommerce_product_add_to_cart_text' filter for all product types/ cases.
*
* @link https://gist.github.com/deckerweb/cf466e017fd01d503469
@deckerweb
deckerweb / print-additions.css
Last active August 29, 2015 14:01
Plugin: Genesis Printstyle Plus - custom print-additions.css
.page #content,
.single #content {
margin-left: 70px !important;
}