WordPress.org

Make WordPress Core

Ticket #12573: 12573.patch

File 12573.patch, 1.1 KB (added by TobiasBg, 4 years ago)

Patch adds missing delete_user_option() function

  • wp-includes/user.php

     
    280280} 
    281281 
    282282/** 
     283 * Delete user option with global blog capability. 
     284 * 
     285 * User options are just like user metadata except that they have support for 
     286 * global blog options. If the 'global' parameter is false, which it is by default 
     287 * it will prepend the WordPress table prefix to the option name. 
     288 * 
     289 * @since 3.0.0 
     290 * @uses $wpdb WordPress database object for queries 
     291 * 
     292 * @param int $user_id User ID 
     293 * @param string $option_name User option name. 
     294 * @param bool $global Optional. Whether option name is blog specific. 
     295 * @return unknown 
     296 */ 
     297function delete_user_option( $user_id, $option_name, $global = false ) { 
     298        global $wpdb; 
     299 
     300        if ( !$global ) 
     301                $option_name = $wpdb->prefix . $option_name; 
     302        return delete_user_meta( $user_id, $option_name ); 
     303} 
     304 
     305/** 
    283306 * Get users for the blog. 
    284307 * 
    285308 * For setups that use the multi-blog feature. Can be used outside of the