Refresh page after update_post_meta

I have created a input field on a front-page where the value of the database is on the same page as the input-field. If a value is passed to the database I have to reload the page for it to show on the page.

Is there a way where I can automatically refresh the page after the value is passed to the database, so it is shows instantly?

My guess would be JQuery but I don't know how!

M.

Topic input php jquery database Wordpress

Category Web


Try this code Refresh page after update_user_meta

add_action( 'user_meta_after_user_update', 'refreshPage' );
function refreshPage() {
  echo '<script>location.reload();</script>';
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.