Change user meta value with shortcode

You made error, you made checks on the value which were null, i compile your code and made changes, here is the code it will help you. function wp_change_namecar( $atts, $content = null ) { if (is_user_logged_in()) { $user_id = get_current_user_id(); $userval =$_POST[‘cars’]; //how to define that it is the value of the form? if … Read more

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