Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Decker deckerweb

🏠
Working from home
View GitHub Profile
View theme-updates.php
<?php
/* Set up Licence key for this theme. URL: https://easydigitaldownloads.com/docs/activating-license-keys-in-wp-plugins-and-themes */
/* This is the URL our updater / license checker pings. This should be the URL of the site with EDD installed. */
define( 'MINA_OLEN_SL_STORE_URL', 'http://localhost/foxnet-themes-shop' ); // use your own unique prefix to prevent conflicts
/* The name of your product. This should match the download name in EDD exactly. */
define( 'MINA_OLEN_SL_THEME_NAME', 'Mina olen' ); // use your own unique prefix to prevent conflicts
View woocommerce-delete-customer-ip.php
<?php
/**
* Snippet for deleting the customer IP address from WooCommerce orders.
* Important for Trusted Shops® certificates in Germany.
*/
add_action( 'woocommerce_checkout_update_order_meta', 'mp1401091554', 1 );
function mp1401091554( $order_id ) {
update_post_meta(
$order_id,
'_customer_ip_address',
@deckerweb
deckerweb / wcde-custom-string-swap-cart-total.php
Last active Aug 29, 2015
DE: Benutzerdefinierte Begriffsänderung (String Swap) für "Warenkorb-Zwischensumme" in WooCommerce - setzt Plugin "WooCommerce German (de_DE)" voraus! // EN: Custom String Swap for "Cart Subtotal" in WooCommerce - relies on active plugin "WooCommerce German (de_DE)"!
View wcde-custom-string-swap-cart-total.php
<?php
/** Do NOT include the opening php tag */
add_action( 'get_header', 'wcde_custom_string_swap_cart_subtotal', 99 );
/**
* String swap for "Cart Subtotal:"/ "Cart Subtotal" string in WooCommerce.
*
* NOTE: This snippet relies on active "WooCommerce German (de_DE)" plugin,
@deckerweb
deckerweb / genesis-printstyle-plus-snippets.php
Last active Aug 29, 2015
Genesis Printstyle Plus plugin v1.0.0 or higher -- helper functions, plus filters for customizing and branding
View genesis-printstyle-plus-snippets.php
<?php
/** Do NOT include the opening php tag! */
//
View functions.php
/**
* Change Image Alignment of Featured Image From Left to Right
*
*/
function sk_change_image_alignment( $attributes ) {
$attributes['class'] = str_replace( 'alignleft', 'alignright', $attributes['class'] );
return $attributes;
}
@deckerweb
deckerweb / my-account_v1.php
Last active Aug 29, 2015
Custom Template -- WooCommerce 2.1.x / 2.0.x -- Für "Mein Konto" --- Geht ins Theme/ Child Theme unter: wp-content/themes/*dein-theme*/woocommerce/myaccount/my-account.php --- 2 Beispiele unten, Zeile 19 ist die entscheidende :)
View my-account_v1.php
<?php
/**
* My Account page
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@deckerweb
deckerweb / selbstabholung.po
Created Apr 3, 2014
"Selbstabholung" Strings in WCDE:
View selbstabholung.po
# in WC 2.0.x und 2.1.x - seitdem nix geändert:
#: includes/shipping/local-pickup/class-wc-shipping-local-pickup.php:25
#: includes/shipping/local-pickup/class-wc-shipping-local-pickup.php:84
msgid "Local Pickup"
msgstr "Selbstabholung"
#: includes/shipping/local-pickup/class-wc-shipping-local-pickup.php:77
msgid "Enable local pickup"
msgstr "Selbstabholung aktivieren"
@deckerweb
deckerweb / wcde-custom-string-terms-conditions.php
Created May 12, 2014
WooCommerce Deutsch (de_DE), für Plugin-Version 3.1.5 oder höher: benutzerdefinierter Text für AGB/ Widerruf bei "Kasse" (Checkout):
View wcde-custom-string-terms-conditions.php
<?php
/** Do NOT include the opening php tag */
add_filter( 'wcde_filter_terms_conditions_string', 'wcde_custom_string_terms_conditions', 10, 1 );
/**
* String swap for "Cart Subtotal:" string in WooCommerce.
*
* NOTE: This snippet relies on active "WooCommerce German (de_DE)" plugin,
@deckerweb
deckerweb / print-additions.css
Last active Aug 29, 2015
Plugin: Genesis Printstyle Plus - custom print-additions.css
View print-additions.css
.page #content,
.single #content {
margin-left: 70px !important;
}
View all_fields_extra_options.php
/**
* 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 ) {