Updating table after approval
-
I am trying to update a table when the user is approved. The code I am using to try and update the table works in the users profile page when they update the zipcode, so I am trying to append this code to the approval section.
elseif ( 'Approve' == $action ) { global $wpdb; // get the zipcode value $zipcode = xprofile_get_field_data( 5, $user_id ); switch ( $zipcode ) { case '10026': $wpdb->update( 'wppl_friends_locator', array( 'zipcode' => '10026', 'lat' => '40.802381', 'long' => '-73.952681' ), array( 'member_id' => $user_id ), array( '%s', '%s', '%s' ), array( '%d' ) ); break; case '10027': $wpdb->update( 'wppl_friends_locator', array( 'zipcode' => '10027', 'lat' => '40.811407', 'long' => '-73.953060' ), array( 'member_id' => $user_id ), array( '%s', '%s', '%s' ), array( '%d' ) ); break; } bp_registration_set_moderation_status( $user_id, 'false' ); bp_core_process_spammer_status( $user_id, 'ham' ); //assigns role upon approval wp_update_user(array( 'ID' => $user_id, 'role' => 'subscriber' )); do_action( 'bpro_hook_approved_user', $user_id ); bp_registration_options_delete_user_count_transient(); $sql = "DELETE FROM wp_signups WHERE user_email='". $user->user_login . "'"; $wpdb->query($sql); }I tried moving the switch statement to end thinking maybe it’s a placement issue. Any idea?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
The topic ‘Updating table after approval’ is closed to new replies.