summaryrefslogtreecommitdiffstats
path: root/wp-admin/profile-update.php
blob: 631018616023dda5cbe798dbc2cb140a4bf0f160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

$parent_file = 'profile.php';
$submenu_file = 'profile.php';
require_once('admin.php');

check_admin_referer('update-profile_' . $user_ID);

if ( !$_POST )
	wp_die( __('No post?') );

$errors = edit_user($user_ID);

if ( is_wp_error( $errors ) ) {
	foreach( $errors->get_error_messages() as $message )
		echo "$message<br />";
	exit;
}

if ( isset( $_POST['primary_blog'] ) ) {
	$primary_blog = (int) $_POST['primary_blog'];
	update_user_option( $current_user->id, 'primary_blog', $primary_blog, true );
}

do_action('personal_options_update');

if ( 'profile' == $_POST['from'] )
	$to = 'profile.php?updated=true';
else
	$to = 'profile.php?updated=true';

wp_redirect( $to );
exit;

?>