WPDev.one
Core Function
View Source on Trac ↗

get_option()

get_option( mixed $option, mixed $default_value = false )

Retrieves an option value based on an option name.

Parameters 1 required

Name / Type Description
$option
string

Name of the option to retrieve. Expected to not be SQL-escaped.

Required
$default_value
mixed

Optional. Default value to return if the option does not exist.

Return Value

(mixed)
mixed Value of the option. A value of any type may be returned, including scalar (string, boolean, float, integer), null, array, object. Scalar and null values will be returned as strings as long as they originate from a database stored option value. If there is no option in the database, boolean `false` is returned.

Function Information

Since Version
1.5.0
Source File
wp-includes/option.php
Advertisement