View base64 sh.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/bin/echo "{md5}"`/bin/echo -n "password" | openssl dgst -binary -md5 | openssl enc -base64` |
View gist:8ca1b1b33ab791836a59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wc_filter_search_add_post_type( $array ) { | |
array_push( $array, 'your_post_type' ); | |
array_push( $array, 'another_post_type' ); | |
array_push( $array, 'etc' ); | |
return array; | |
} | |
add_filter( 'wc_filter_search_not_allowed_array', 'wc_filter_search_add_post_type' ); |
View gist:2537e52cb10feeebd639
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_product_thumbnails'. 'your_custom_function' ); | |
function your_custom_function() { | |
?> | |
<img src="http://domain.com/image.jpg" title="Your title" alt="Your alt" /> | |
<?php | |
} |
View gist:3659c323e25d50d135c7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add VAT and SSN fields to the checkout form | |
add_filter( 'woocommerce_checkout_fields' , 'custom_add_vat_ssn_fields' ); | |
function custom_add_vat_ssn_fields( $fields ) { | |
if ( ! isset( $fields['billing']['billing_vat'] ) ) { | |
$fields['billing']['billing_vat'] = array( | |
'label' => __( 'VAT', 'your-domain' ), | |
'placeholder' => _x( 'VAT', 'placeholder', 'your-domain' ), | |
'required' => true, //change to false if you do not need this field to be required | |
'class' => array( 'form-row-first' ) | |
); |
View gist:b87314a6267b45c41302
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_my_account_my_address_formatted_address', 'custom_my_account_my_address_formatted_address', 10, 3 ); | |
function custom_my_account_my_address_formatted_address( $fields, $customer_id, $type ) { | |
if ( $type == 'billing' ) { | |
$fields['vat'] = get_user_meta( $customer_id, 'billing_vat', true ); | |
$fields['ssn'] = get_user_meta( $customer_id, 'billing_ssn', true ); | |
} | |
return $fields; | |
} |
View gist:21899c057aad33fd9fdd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add VAT and SSN fields in billing address display | |
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_add_vat_ssn_formatted_billing_address', 10, 2 ); | |
function custom_add_vat_ssn_formatted_billing_address( $fields, $order ) { | |
$fields['vat'] = $order->billing_vat; | |
$fields['ssn'] = $order->billing_ssn; | |
return $fields; | |
} | |
add_filter( 'woocommerce_admin_billing_fields', 'custom_admin_billing_fields' ); |
View jquery.wc-custom.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function ( $ ) { | |
$( 'button.load_customer_billing' ).off( 'click' ); | |
$( 'button.load_customer_billing' ).on( 'click', function() { | |
if ( window.confirm( woocommerce_admin_meta_boxes.load_billing ) ) { | |
// Get user ID to load data for | |
var user_id = $( '#customer_user' ).val(); | |
if ( ! user_id ) { | |
window.alert( woocommerce_admin_meta_boxes.no_customer_selected ); |
View gist:896fd11690b7d6597460
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'admin_enqueue_scripts', 'enqueue_custom_wc_load_address_js' ); | |
function enqueue_custom_wc_load_address_js() { | |
wp_enqueue_script( 'custom-wc-load-address', untrailingslashit( get_template_directory_uri() ) . '/jquery.wc-custom.js', array( 'wc-admin-order-meta-boxes' ) ); | |
} |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add VAT and SSN fields in billing address display | |
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_add_vat_ssn_formatted_billing_address', 10, 2 ); | |
function custom_add_vat_ssn_formatted_billing_address( $fields, $order ) { | |
$fields['vat'] = $order->billing_vat; | |
$fields['ssn'] = $order->billing_ssn; | |
return $fields; | |
} | |
add_filter( 'woocommerce_my_account_my_address_formatted_address', 'custom_my_account_my_address_formatted_address', 10, 3 ); |
View gist:ecd29ce7b1cc5fa1e1ba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( is_numeric( $download['downloads_remaining'] ) ) | |
echo apply_filters( 'woocommerce_available_download_count', '' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . ' ', $download ); |
OlderNewer