Skip to content

Instantly share code, notes, and snippets.

View kosvrouvas's full-sized avatar

Kostas Vrouvas kosvrouvas

View GitHub Profile
@kosvrouvas
kosvrouvas / gist:fe573d8a569d0de2b3ee1f494d8333ef
Last active May 25, 2023 08:14
SourceTree custom action to open project to VS Code in MacOS
// Add this to Script to run
/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
// Add this to Parameters
$REPO
add_filter( 'random_password', 'disable_suggested_password', 10, 2 );
function disable_suggested_password( $password ) {
$action = isset( $_GET['action'] ) ? $_GET['action'] : '';
if ( 'wp-login.php' === $GLOBALS['pagenow'] && ( 'rp' == $action || 'resetpass' == $action ) ) {
return '';
}
return $password;
}
@kosvrouvas
kosvrouvas / woo_sent_coupon_mail.php
Last active September 26, 2022 08:52
WooCommerce: Send a second email to customer if a coupon is applied with HTML
// In theme's functions.php or plug-in code:
// wp_mail() sents emails only in plain text by default, here we add HTML support
function wp_set_content_type(){
return "text/html";
}
add_filter( 'wp_mail_content_type','wp_set_content_type' );
function action_woocommerce_applied_coupon( $coupon_code ) {
// NOT logged in, return