WordPress.org

Make WordPress Core

Ticket #20274: 20274.diff

File 20274.diff, 1.9 KB (added by duck_, 3 years ago)
  • wp-includes/user.php

     
    10611059 * when calling filters. 
    10621060 * 
    10631061 * @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. 
    10711066 * @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. 
    10751068 * 
    10761069 * @param string $field The user Object field name. 
    10771070 * @param mixed $value The user Object value. 
     
    10911084        if ( !is_string($value) && !is_numeric($value) ) 
    10921085                return $value; 
    10931086 
    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_' ); 
    10991088 
    11001089        if ( 'edit' == $context ) { 
    11011090                if ( $prefixed ) {