How to update and save user metadata on page visits?

There are lots of actions you can hook into to do this, I think the best once to use would be wp or template_redirect. Using either of those actions the code would be like this, this code goes into the functions.php add_action(‘wp’, ‘bt_update_user_homepage_meta’); function bt_update_user_homepage_meta () { // get user id, if user is not … Read more

How to add fields in custom registration form, validate it and aave to db? [closed]

To modify the theme’s registration would be possible, but definitely not recommended. It is likely that you would only be able to add your additional fields by directly modifying the theme files, especially with something like user registration. It would be a pain to maintain if you intend to keep your theme up to date. … Read more

Combining wp_list_authors with get_user_meta

What you want is not supported by wp_list_authors(). To output them the way you want you will need to use get_users() and display them yourself. $authors = get_users( array( ‘orderby’ => ‘display_name’, ‘order’ => ‘ASC’ ) ); foreach ( $authors as $author ) { echo esc_html( $author->last_name . ‘ ‘ . $author->first_name ); } You … Read more

Associate multiple email addresses with the same user account, so they can log in with either

If you create them programmatically, you could set it up so that all of the usernames are one type of email address (business or personal) and the WP email address field contains the other type. It’s not clear if this would fit your particular use case, but one other login possibility is to integrate single … Read more

ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?

New answer I now have a better understanding of the question thanks to OPs comment and have come up with the following. Not tested! global $wpdb; /** * @var string $field The flexible content field name. */ $field = ‘a_flexible_content_field’; /** * @var string $layout The flexible layout name. */ $layout=”layoutTwo”; /** * @var string … Read more

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