Landing on a page updates user data (1 post)

  1. onewhale
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic