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

vi:Tham Khảo Các Hàm/get 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ả

A safe way of getting values for a named option from the options database table. If the desired option does not exist, or no value is associated with it, FALSE will be returned.

Sử dụng

 <?php echo get_option('show'); ?> 

Ví dụ

Show Blog Title

Displays your blog's title in a <h1> tag.

 <h1><?php echo get_option('blogname'); ?></h1> 

Show Character Set

Displays the character set your blog is using (ex: UTF-8)

 <p>Character set: <?php echo get_option('blog_charset'); ?> </p> 

Retrieve Administrator E-mail

Retrieve the e-mail of the blog administrator, storing it in a variable.

 <?php $admin_email get_option('admin_email'); ?> 


(string) (required) Name of the option to retrieve. A list of valid default options can be found at the Option Reference.
Default: None


add_option, update_option

See also index of Function Reference and index of Template Tags.