Update Post Meta for a logged in user
Welcome to WPSE. A few problems to note: $user_id is not defined so your call to wp_get_current_user() is passing a null value as a parameter. $current_user = wp_get_current_user($user_id);. // $user_id is not defined wp_get_current_user() does not accept parameters. See the documentation here: https://developer.wordpress.org/reference/functions/wp_get_current_user/ This line $current_user->ID; does nothing. There is no ID method in the … Read more