Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Jon Ander Luna

Ultimate member field, dont update.

Hello, on the users page, I have added a custom field that comes from the user record with ultimate member.
But when editing this field inline, it is not updated in the user profile until I update a field in the user table, such as email.
What I can do?

3 years, 11 months ago
Stefan van den Dungen Gronovius
Developer

Do you see the change on the user edit screen after you’ve edited the field with our inline edit feature? But only after you save the user it is actually visible on the front-end? This sounds like a caching issue. Do you have a caching plugin available on your website? Maybe the page is refreshed after the user is actually saved through the WordPress wp_update_user() method. You could use the following snippet and see if that changes anything.

add_action( 'acp/editing/saved', function ( AC\Column $column, $id ) {
  if ( $column->get_list_screen() instanceof AC\ListScreen\User ) {
    wp_update_user( [ 'ID' => $id ] );
  }
}, 10, 2 );

It is based on the first example on this page where we do a similar thing for posts.
https://www.admincolumns.com/documentation/action-reference/acp-editing-saved/

3 years, 11 months ago
Jon Ander Luna

Thank you very much, I have tried it and it works correctly.

3 years, 11 months ago

You must be logged in to reply to this topic.