here to edit your profile.', 'profile'); ?>
0 ) echo '' . implode("
", $error) . '
$current_user->ID, 'user_pass' => esc_attr( $_POST['pass1'] ) ) ); else $error[] = __('The passwords you entered do not match. Your password was not updated.', 'profile'); } /* Update user information. */ if ( !empty( $_POST['url'] ) ) wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => esc_url( $_POST['url'] ) ) ); if ( !empty( $_POST['email'] ) ){ if (!is_email(esc_attr( $_POST['email'] ))) $error[] = __('The Email you entered is not valid. please try again.', 'profile'); elseif(email_exists(esc_attr( $_POST['email'] )) != $current_user->id ) $error[] = __('This email is already used by another user. try a different one.', 'profile'); else{ wp_update_user( array ('ID' => $current_user->ID, 'user_email' => esc_attr( $_POST['email'] ))); } } if ( !empty( $_POST['first-name'] ) ) update_user_meta( $current_user->ID, 'first_name', esc_attr( $_POST['first-name'] ) ); if ( !empty( $_POST['last-name'] ) ) update_user_meta($current_user->ID, 'last_name', esc_attr( $_POST['last-name'] ) ); if ( !empty( $_POST['description'] ) ) update_user_meta( $current_user->ID, 'description', esc_attr( $_POST['description'] ) ); if ( !empty( $_POST['channel_name'] ) ) update_user_meta( $current_user->ID, 'channel_name', esc_attr( $_POST['channel_name'] ) ); if ( !empty( $_POST['pic'] ) ) update_user_meta( $current_user->ID, 'pic', esc_attr( $_POST['pic'] ) ); if ( !empty( $_POST['description_channel'] ) ) update_user_meta( $current_user->ID, 'description_channel', esc_attr( $_POST['description_channel'] ) ); /* Redirect so the page will show updated info.*/ /*I am not Author of this Code- i dont know why but it worked for me after changing below line to if ( count($error) == 0 ){ */ if ( !$error ) { wp_redirect( get_permalink() .'?updated=true' ); exit; } } if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /* UNTIL HERE */ get_header(); /* HERE AGAIN, ADDED code to create the profile form for channels */ if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
here to edit your profile.', 'profile'); ?>
0 ) echo '' . implode("
", $error) . '