* @return int The current user's ID
*/
function get_current_user_id() {
+ if ( ! function_exists( 'wp_get_current_user' ) )
+ return 0;
$user = wp_get_current_user();
return ( isset( $user->ID ) ? (int) $user->ID : 0 );
}
$this->query_vars[$query_var] = $value;
}
- /*
+ /**
* Used internally to generate an SQL string for searching across multiple columns
*
* @access protected
* @uses add_metadata()
* @link http://codex.wordpress.org/Function_Reference/add_user_meta
*
- * @param int $user_id Post ID.
+ * @param int $user_id User ID.
* @param string $meta_key Metadata name.
* @param mixed $meta_value Metadata value.
* @param bool $unique Optional, default is false. Whether the same key should not be added.
* @uses get_metadata()
* @link http://codex.wordpress.org/Function_Reference/get_user_meta
*
- * @param int $user_id Post ID.
+ * @param int $user_id User ID.
* @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
* @param bool $single Whether to return a single value.
* @return mixed Will be an array if $single is false. Will be value of meta data field if $single
* @uses update_metadata
* @link http://codex.wordpress.org/Function_Reference/update_user_meta
*
- * @param int $user_id Post ID.
+ * @param int $user_id User ID.
* @param string $meta_key Metadata key.
* @param mixed $meta_value Metadata value.
* @param mixed $prev_value Optional. Previous value to check before removing.
/**
* Insert an user into the database.
*
- * Can update a current user or insert a new user based on whether the user's ID
- * is present.
- *
- * Can be used to update the user's info (see below), set the user's role, and
- * set the user's preference on whether they want the rich editor on.
- *
* Most of the $userdata array fields have filters associated with the values.
* The exceptions are 'rich_editing', 'role', 'jabber', 'aim', 'yim',
* 'user_registered', and 'ID'. The filters have the prefix 'pre_user_' followed
*
* @since 2.0.0
* @see wp_insert_user() For what fields can be set in $userdata
- * @uses wp_insert_user() Used to update existing user or add new one if user doesn't exist already
*
* @param mixed $userdata An array of user data or a user object of type stdClass or WP_User.
* @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated.
* @since 2.9.0
*
* @param array $methods Array of contact methods and their labels.
- * @param WP_User $user Optional. WP_User object.
+ * @param WP_User $user WP_User object.
*/
return apply_filters( 'user_contactmethods', $methods, $user );
}