/** * This snippet removes the WP emoji code from the WP header. */ remove_action( 'wp_head', …
Remove WP emoji code from site header
/** * The following removes the WP emoji code from your site's header. * * Note the priority "7" for the wp_head remove action. This …
Shortcode to display list of categories
/** * This creates the [my_cat_list] shortcode. * * The shortcode will display a list of categories. * * @link …
Decrease Password Strength Requirements for WooCommerce
/** * 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 ) …