WordPress:Function Reference/get option

来自站长百科
Fludlen讨论 | 贡献2008年7月22日 (二) 13:27的版本
跳转至: 导航、​ 搜索

Description

描述

A safe way of getting values for a named option from the options database table. If the desired option does not exist, FALSE will be returned. 为选项数据库表格中安全地得到指定的一个选项的参数值。如果没有想要的选项,会返回错误的

Usage

用法

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

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

Examples

例子

Show Blog Title

显示博客标题

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

在<h1>标签中显示你的博客标题。

%%%

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

 %%% %%%

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

 %%%

Show Character Set

显示字符集

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

显示你的博客使用的字符集(例如:UTF-8)

%%%

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

 %%% %%%

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

 %%%

Retrieve Administrator E-mail

得到管理员电子邮件

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

得到博客管理员的电子邮件并且将电子邮件储存在一个变数中。

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

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

Parameters

参数

Related

相关的

模板:Tag General Tags

模板:Tag Footer

模板:标签总标签

模板:标签页底文字