From 0344154048ad4d0f61ce749c94d55b90e738f41c Mon Sep 17 00:00:00 2001 From: westi Date: Tue, 11 Mar 2008 21:37:23 +0000 Subject: [PATCH] Allow plugins to filter the result of get_user_option(). git-svn-id: http://svn.automattic.com/wordpress/trunk@7253 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 83d85fb3b..972aadd0d 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -89,11 +89,13 @@ function get_user_option( $option, $user = 0 ) { $user = get_userdata($user); if ( isset( $user->{$wpdb->prefix . $option} ) ) // Blog specific - return $user->{$wpdb->prefix . $option}; + $result = $user->{$wpdb->prefix . $option}; elseif ( isset( $user->{$option} ) ) // User specific and cross-blog - return $user->{$option}; + $result = $user->{$option}; else // Blog global - return get_option( $option ); + $result = get_option( $option ); + + return apply_filters("get_user_option_{$option}", $result, $option, $user); } function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {