Edit data and current user in front-end

Question
  if(isset($_POST['edit'])){
  global $current_user;
  $current_user = wp_get_current_user();
  if($current_user){
  $tablename = 'wp_users';  
  $data = array(
          'display_name' => $_POST['display_name'],
  );

 $wpdb->update($tablename, $data, $format=NULL);
 }}

I want to edit current username in front-end but it does not working. Anyone can help me.

0
rahimi roslan 2 months 0 Answers 14 views 0

Leave an answer