WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

vi:Tham Khảo Các Hàm/get user option

Bản Nháp

Trang này được đánh dấu là bản nháp. Bạn có thể giúp đỡ WordPressVN bằng cách hoàn thiện trang này.

Mô tả

Trả lại tùy chọn của thành viên global, user, hoặc blog.

If the user ID is not given, then the current user will be used instead. If the user ID is given, then the user data will be retrieved. The filter for the result will also pass the original option name and finally the user data object as the third parameter.

The option will first check for the non-global name, then the global name, and if it still doesn't find it, it will try the blog option. The option can either be modified or set by a plugin.

Các sử dụng

<?php get_user_option$option$user$check_blog_options ?>

Tham số

$option
(string) (required) User option name.
Default: None
$user
(integer) (optional) User ID.
Default: 0
$check_blog_options
(boolean) (optional) Whether to check for an option in the options table if a per-user option does not exist.
Default: true

Giá trị trả lại

(mixed) 

Ví dụ

Notes

  • Uses: apply_filters() Calls 'get_user_option_$option' hook with result, option parameter, and user data object.
  • Uses global: (object) $wpdb WordPress database object for queries.

Change Log

Since: 2.0.0

Source File

get_user_option() is located in wp-includes/user.php.

Related