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

Show username only if logged in in a else no directly name

this is the whole code in stoerer.php <!doctype html> <html lang=”de”> <meta charset=”utf-8″> <title> Störer</title> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script> <link rel=”stylesheet” href=”style.css” type=”text/css”> </head> <body> <header> <button>Ich bin ein Störer</button> <!– Und dann die Info-Box –> <div id=”infoBox”> <button class=”cross” type=”button”>X</button> <p> Hello </p> <?php wp_get_current_user(); ?> <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)