Pass user object through _wp_get_user_contactmethods() to the user_contactmethods filter. props aaroncampbell, fixes #15186.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin
2010-10-21 15:42:06 +00:00
parent 99a5439b44
commit f5e23028ff
3 changed files with 11 additions and 11 deletions

View File

@@ -110,7 +110,7 @@ function edit_user( $user_id = 0 ) {
if ( isset( $_POST['description'] ) )
$user->description = trim( $_POST['description'] );
foreach ( _wp_get_user_contactmethods() as $method => $name ) {
foreach ( _wp_get_user_contactmethods( $user ) as $method => $name ) {
if ( isset( $_POST[$method] ))
$user->$method = sanitize_text_field( $_POST[$method] );
}
@@ -224,7 +224,7 @@ function get_editable_roles() {
function get_user_to_edit( $user_id ) {
$user = new WP_User( $user_id );
$user_contactmethods = _wp_get_user_contactmethods();
$user_contactmethods = _wp_get_user_contactmethods( $user );
foreach ($user_contactmethods as $method => $name) {
if ( empty( $user->{$method} ) )
$user->{$method} = '';