apply_filters( "option_{$option}", mixed $value , string $option )
Filters the value of an existing option.
Contents
Description Description
The dynamic portion of the hook name, $option
, refers to the option name.
Parameters Parameters
- $value
-
(mixed) Value of the option. If stored serialized, it will be unserialized prior to being returned.
- $option
-
(string) Option name.
More Information More Information
This hook allows you to filter any option after database lookup.
Source Source
File: wp-includes/option.php
Changelog Changelog
Version | Description |
---|---|
4.4.0 | The $option parameter was added. |
3.0.0 | |
1.5.0 | Introduced. |
Quick tip for disabling a plugin at run time using the ‘active_plugins’ option:
Top ↑
Feedback #Feedback
from what I know $plugins array’s keys are numbers so $plugins[‘my-plugin-slug’] won’t work — By Radu —
Example migrated from Codex:
For example, to filter the blog description, you may use
option_blogdescription
.In the following sample code, we change the blog description on archive pages to include a page number (i.e. changing to “Example description. Page 2“). This is a common usage scenario to avoid duplicate meta description error in Google Webmaster Tools.
Expand full source codeCollapse full source code