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
// Blacklist woocommerce customer registration | |
function blacklisted_user( $errors, $sanitized_user_login, $user_email ) { | |
// Blacklist email domains | |
$blacklist = ['tmomail.net', 'vtext.com', 'txt.att.net']; | |
$email_parts = explode( '@', $user_email ); | |
if ( is_numeric( $email_parts[0] ) ) { | |
// If the user email first part is numeric, add an error message | |
$errors->add( 'blacklist_error', '<strong>ERROR</strong>: This email is not allowed to register on this site.' ); |
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
/** | |
* For test and debug, log function to view any data in wp-content/debug.log | |
* uses: log_it($variable); | |
* | |
*/ | |
if ( ! function_exists( 'log_it' ) ) { | |
function log_it( $message ) { | |
if ( WP_DEBUG === true ) { | |
if ( is_array( $message ) || is_object( $message ) ) { | |
error_log( "\r\n" . print_r( $message, true ) ); |
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
$ npx npm-check-updates -u | |
$ npm install |
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
// from current folder and all its sub folder | |
find . -type d -exec chmod 0755 {} \; | |
find . -type f -exec chmod 0644 {} \; |
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
/* | |
* Set up your Git configuration | |
*/ | |
git config --global user.email "you@yourdomain.com" | |
git config --global user.name "Your Name" | |
git config --global core.editor "nano" |
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 WooCommerce Checkbox checkout | |
*/ | |
function tkd_add_checkout_checkbox() { | |
woocommerce_form_field( 'checkout-checkbox', array( // CSS ID | |
'type' => 'checkbox', | |
'class' => array('form-row mycheckbox'), // CSS Class | |
'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'), | |
'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'), |
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
$arrayOne = Array | |
( | |
"_wvs_pro_swatch_option" => Array | |
( | |
"default_to_button" => "yes", | |
"default_to_image" => "yes", | |
"default_image_type_attribute" => "", | |
"pa_color" => Array | |
( | |
"default_type" => "select", |
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
/** Register custom product type */ | |
add_action( 'init', 'register_gwp_bundle_product_type' ); | |
function register_gwp_bundle_product_type () { | |
class WC_Product_gwp_bundle extends WC_Product { | |
public function __construct( $product ) { | |
$this->product_type = 'gwp_bundle'; | |
parent::__construct( $product ); | |
} | |
} |
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
<?php | |
/** | |
* Simple excel writer class with no external dependencies, drop it in and have fun | |
* @author Matt Nowack | |
* @license Unlicensed | |
* @version 1.0 | |
*/ | |
class Excel { | |
private $col; |
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
<?php | |
/** | |
* Function: convert_number | |
* | |
* Description: | |
* Converts a given integer (in range [0..1T-1], inclusive) into | |
* alphabetical format ("one", "two", etc.) | |
* | |
* @int | |
* |
NewerOlder