/** * Change WooCommerce required password strength. * * WooCommerce password strength requirement is determined by an integer …
Remove WooCommerce Password Strength Meter
add_action( 'wp_print_scripts', 'my_woo_remove_password_strength', 10 ); function my_woo_remove_password_strength() { …
Set user role to WordPress default role during WooCommerce checkout
add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { …
Set custom user role during WooCommerce checkout
add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { …
Disallow spaces in WordPress usernames
add_filter( 'validate_username', 'my_no_space_username', 10, 2 ); /** * Checks to see if a username contains whitespace. * @see: …
MySQL delete records in one table that do not exist in another table
DELETE FROM content_to_tags WHERE NOT EXISTS ( SELECT * FROM content WHERE content_id = content_to_tags.content_id ) …
MySQL update column in one table with data from another table
update table1 t1 join table2 t2 on t2.field = t1.field set t1.field1 = t2.matchingfield where t1.whatever = t2.whatever …
MySQL copy table data to a new table
CREATE TABLE backup_table LIKE existing_table; INSERT backup_table SELECT * FROM existing_table; …
Get all WordPress user emails
$users = get_users(); foreach ( $users as $user ) { $email = $user->user_email; } …