Fetch data from a WP page with same name as current username

According with docs, when you want to retrieve field attached to post using get_field / the_field you should pass a numeric ID as 2nd argument. You are passing a string. So your code should work if: $login = wp_get_current_user()->user_login; $page = $login ? get_page_by_path( $login ) : false; $field = $page ? get_field(‘my_custom_field’, $page->ID) : … Read more

Username from e-mail

As far as i know there is no hook or filter to provide a custom User name for default registration process, however if you really want to modify it, you can alter the $_POST data. here is the sample code: add_action(‘wp_loaded’, ‘wpse_138736_filter_username’); function wpse_138736_filter_username(){ //your code to extract username from email $_POST[‘user_login’] = ‘test’; } … Read more

Username has been exposed

Yes, the links will always be accessible unless you disable them on your htaccess or a PHP file. If you don’t have any author page, probably the users (or bots) that are reaching this page are seeing your index page. I highly recommend you install Google Analytics code on your website to track what your … Read more

forgot password

You can reset it in phpmyadmin if it’s your own site by using a utility to replace it in the database. Search for ‘WordPress password generator’ and this should show you the way. If it’s not your site, contact the administrator or check your spam. Obviously if there’s a site admin you know, get them … Read more

How to set an array of current usernames

So right now you have this if ($user && isset($user->user_login) && ‘username’ == $user->user_login ) { To check for one specific user. If you want to check against multiple usernames, PHP’s function in_array() comes in handy $allowed = array( ‘user1’, ‘user2’, ); if ($user && isset($user->user_login) && in_array($user->user_login, $allowed) ) {

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