Skip to content

Instantly share code, notes, and snippets.

@7einhalb
7einhalb / functions.php
Created February 25, 2021 22:06 — forked from patrickposner/functions.php
WooCommerce: Straße und Hausnummer auftrennen
<?php
add_filter( 'woocommerce_default_address_fields', 'pp_rename_address_checkout', 9999 );
/**
* Modify address field labe.s
*
* @param array $address_fields current address fields.
* @return array
*/
function pp_rename_address_checkout( $address_fields ) {
@7einhalb
7einhalb / functions.php
Created March 17, 2020 19:21
accept shortcodes for CF7
<?php
/* ### accept shortcodes for CF7 ### */
add_filter( 'wpcf7_form_elements', 'do_shortcode' );
@7einhalb
7einhalb / snippet.js
Last active July 12, 2021 07:16
all external links in new Tab (_blank + noopener)
// externe Links in neuem Tab öffnen
<script type="text/javascript">
jQuery(document).ready( function($) {
// Open all external link in a new tab
$('a').each(function() {
var a = new RegExp('/' + window.location.host + '/');
if (!a.test(this.href)) {
// This is an external link
$(this).addClass('external').attr('target','_blank').attr('rel','noopener');
@7einhalb
7einhalb / CF7 - Shortcode
Created September 19, 2019 07:52
Contact Form 7 - Spamschutz Quiz
[quiz random-math-quiz "Spamschutz: Wieviel ist eins plus zwei? (Bitte Zahl eingeben)|3"
"Spamschutz: Wieviel ist drei minus zwei? (Bitte Zahl eingeben)|1"
"Spamschutz: Wieviel ist fünf minus zwei? (Bitte Zahl eingeben)|3"
"Spamschutz: Wieviel ist zehn minus zwei? (Bitte Zahl eingeben)|8"
"Spamschutz: Wieviel ist elf minus zwei? (Bitte Zahl eingeben)|9"
"Spamschutz: Wieviel ist zehn minus fünf? (Bitte Zahl eingeben)|5"
"Spamschutz: Wieviel ist drei minus zwei? (Bitte Zahl eingeben)|1"
"Spamschutz: Wieviel ist zehn plus eins? (Bitte Zahl eingeben)|11"]
@7einhalb
7einhalb / functions.php
Created September 19, 2019 07:16
Shortcode für Google Analytics OptOut (Datenschützerklärung)
/* Google Analytics Opt-Out-Link */
// Shortcode [gp_optout]link[/gp_optout]
function gaool_shortcode_optout( $atts, $content = null ) {
return '<a onclick="alert(\'Das Tracking durch Google Analytics wurde in Ihrem Browser für diese Website deaktiviert\');" href="javascript:gaOptout()">' . $content . '</a>';
}
add_shortcode( 'gp_optout', 'gaool_shortcode_optout' );
@7einhalb
7einhalb / chengelog.md
Last active July 12, 2021 07:16
WP Login Branding & Backend CSS

2020-07-30

  • CSS erweitert

2020-05-20

  • "login_headertitle" is deprecated since 5.2.0, use "login_headertext" instead