1

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.

1
  • This can be done with jQuery but also you could use PHPs header to do this after the update.
    – Aravona
    Sep 17, 2015 at 10:14

1 Answer 1

1

Try this code Refresh page after update_user_meta

add_action( 'user_meta_after_user_update', 'refreshPage' );
function refreshPage() {
  echo '<script>location.reload();</script>';
}
2
  • 1
    Also some more info as how it helps OP just giving code isn't much helpful.
    – bravokeyl
    Aug 11, 2016 at 9:42
  • you can try this code within your condition ?> <meta http-equiv="refresh" content="0"> <?php Aug 11, 2016 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.