WordPress 中文文档

Function Reference/update option

From WordPress Chinese

Jump to: navigation, search

目录

Description

A safe way of updating or adding a named option/value pair to the options database table. The indata is escaped with %%%$wpdb->escape%%% before the INSERT statement.

This function can be called even if the option does not exist, the function will create the option.

See add_option for more information.

Usage

<?php update_option($name, $value = '', $description = '', $autoload = 'yes'); ?>

Example

Usage

<?php update_option("myhack_extraction_length", '255', 
'Max length of extracted text in characters.', 'yes'); ?>

Parameters

Template:Parameter Template:Parameter Template:Parameter Template:ParameterTemplate:Copyedit

用户