From f4f2b5fc3c2a39eaf45f88b6b1260ee347f9aa52 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Tue, 11 Mar 2008 21:37:23 +0000 Subject: [PATCH] Allow plugins to filter the result of get_user_option(). git-svn-id: https://develop.svn.wordpress.org/trunk@7253 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 83d85fb3bd..972aadd0d3 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 ) {