How to auto-generate random numbers in username?

This function would generate a unique user login slug: function my_unique_user_slug( $slug ) { global $wpdb; $check_sql = “SELECT user_login FROM $wpdb->users WHERE user_login = %s LIMIT 1”; if ( ! $wpdb->get_var( $wpdb->prepare( $check_sql, $slug ) ) ) { return $slug; } $suffix = 2; do { $alt_slug = $slug . $suffix; $user_slug_check = $wpdb->get_var( … Read more

Where do I implement this display of User Meta Data, and how to put it in a table?

If I understood your question correctly, you want to display this data on a page on front-end. In this case you can either create a page template in your theme folder OR create a shortcode in functions.php. Here is a quick shortcode that may help. add_shortcode(‘currentuser’, ‘shortcode_current_user’); function shortcode_current_user($atts){ ob_start(); $current_user = wp_get_current_user(); echo ‘<table>’; … Read more

Fix hover images blink

My suggestion is to get around using background-image, and load both images at the same time. This should prevent the flash of the hover image loading on the first hover. If the images are loaded as images instead of background images, then you can use CSS to set the opacity of the hover image to … Read more

Woocommerce textarea format ignored

The answer you’ve based your code off uses esc_attr() incorrectly on this line: update_post_meta( $variation_id, ‘my_text_field’, esc_attr( $text_field )); esc_attr() is for escaping a value so that it can be placed in an HTML attribute on output. This is a completely incorrect use of it, and it’s what is converting your < and > characters. … Read more