Support » Fixing WordPress » Landing on a page updates user data

  • So I’m making a quiz, which will ultimately land on a members only page, and once they get there I need some PHP code that will update an extra field (already created AND hidden) named ‘module1’ to the numeric value 13

    I’m also using a PHP snippet plugin as it is only on certain pages and this is what I have so far but it doesn’t seem to work

    $current_user = wp_get_current_user();
    wp_update_user( array ( 'ID' => $current_user, 'module1' => 13 ) ) ;

    Thanks in advance!

  • The topic ‘Landing on a page updates user data’ is closed to new replies.