Ready to get started?Download WordPress


Landing on a page updates user data (1 post)

  1. onewhale
    Posted 10 months 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!


You must log in to post.

About this Topic