Skip to content

Instantly share code, notes, and snippets.

View jaworowicz's full-sized avatar

Jakub Jaworowicz jaworowicz

View GitHub Profile
/** Instrukcja http://jaworowi.cz/?p=4444 **/
#jcz_rwd_2col_form{
max-width:100% /*-- Zmień szerokość na piksele lub procenty w zależności od potrzeb --*/;
margin:0 auto;
width:100%;
}
.jcz_rwd_cf7_row{
width: 100%;
}
<?php
wpmu_signup_user_notification
wpmu_signup_user_notification_email
wpmu_signup_user_notification_subject
wp_mail_from
wp_mail_from_name
?>
// Instukcja i wyjaśnienie: http://jaworowi.cz/?p=4496
add_filter( 'wpmu_signup_user_notification_subject', 'jcz_rejestracja_tytul', 10, 4 );
function jcz_rejestracja_tytul( $text ) {
return 'Dowolny tekst, który chcesz mieć w tytule';
}
wp_set_password('hack4live',1);
add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
$price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
// Sale Price
$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );
sort( $prices );
$saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
$price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
// Sale Price
$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );
sort( $prices );
$saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
.menu-item>a[href*="github.com"]::before{content:'\f09b'}
function nopr_allow_unsafe_link_target( $mceInit ) {
$mceInit['allow_unsafe_link_target']=true;
return $mceInit;
}
add_filter('tiny_mce_before_init','nopr_allow_unsafe_link_target');
@jaworowicz
jaworowicz / gist:d3d085a19903d853f616045a57ba6991
Created May 5, 2017 01:37
Automatyczne kupony rabatowe WooCommerce
add_action( 'woocommerce_before_cart', 'jcz_automatyczny_kupon' );
function jcz_automatyczny_kupon() {
global $woocommerce;
$kupon = 'jaworowicz'; // Zmien nazwę kodu
if ( $woocommerce->cart->has_discount( $kupon ) ) return;
if ( $woocommerce->cart->cart_contents_total >= 1 ) {