Ticket #20274: 20274.diff
| File 20274.diff, 1.9 KB (added by duck_, 14 months ago) |
|---|
-
wp-includes/user.php
1061 1059 * when calling filters. 1062 1060 * 1063 1061 * @since 2.3.0 1064 * @uses apply_filters() Calls 'edit_$field' and '{$field_no_prefix}_edit_pre' passing $value and 1065 * $user_id if $context == 'edit' and field name prefix == 'user_'. 1066 * 1067 * @uses apply_filters() Calls 'edit_user_$field' passing $value and $user_id if $context == 'db'. 1068 * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'user_'. 1069 * @uses apply_filters() Calls '{$field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'. 1070 * 1062 * @uses apply_filters() Calls 'edit_$field' passing $value and $user_id if $context == 'edit'. 1063 * $field is prefixed with 'user_' if it isn't already. 1064 * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db'. $field is prefixed with 1065 * 'user_' if it isn't already. 1071 1066 * @uses apply_filters() Calls '$field' passing $value, $user_id and $context if $context == anything 1072 * other than 'raw', 'edit' and 'db' and field name prefix == 'user_'. 1073 * @uses apply_filters() Calls 'user_$field' passing $value if $context == anything other than 'raw', 1074 * 'edit' and 'db' and field name prefix != 'user_'. 1067 * other than 'raw', 'edit' and 'db'. $field is prefixed with 'user_' if it isn't already. 1075 1068 * 1076 1069 * @param string $field The user Object field name. 1077 1070 * @param mixed $value The user Object value. … … 1091 1084 if ( !is_string($value) && !is_numeric($value) ) 1092 1085 return $value; 1093 1086 1094 $prefixed = false; 1095 if ( false !== strpos($field, 'user_') ) { 1096 $prefixed = true; 1097 $field_no_prefix = str_replace('user_', '', $field); 1098 } 1087 $prefixed = false !== strpos( $field, 'user_' ); 1099 1088 1100 1089 if ( 'edit' == $context ) { 1101 1090 if ( $prefixed ) {
