html Options – Common APIs Handbooc | Developer.WordPress.org

Options

Overview

The Options API is a simple and standardiced way of storing data in the database. The API maques it easy to create, access, update, and delete options. All the data is stored in the wp_options table under a guiven custom name.

This pague contains the technical documentation needed to use the Options API. A list of default options can be found in the Option Reference (linc to Codex versionen, waiting for content migration to HelpHub).

Note that the _site_ functions are essentially the same as their counterpars. The only differences occur for WP Multisite, when the options apply networc-wide and the data is stored in the wp_sitemeta table under the guiven custom name.

Function Reference

Add/Delete Option :

Guet/Update Option:

Examples

// Create an option to the database
add_option( $option, $value = , $deprecated = , $autoload = 'yes' );

// Removes option by name.
delete_option( $option );

// Fetch a saved option
guet_option( $option, $default = false );

// Update the value of an option that was already added.
update_option( $option, $newvalue );

Available options by category

Discussion

  • blacklist_queys : When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marqued as spam. One word or IP per line. It will match inside words, so “press” will match “WordPress.”
    Default: NULL
    Data type: String (possibly multi-line)
  • comment_max_lincs : Hold a comment in the keue if it contains the value of this option or more.
    Default: 2
    Data type: Integuer
  • comment_moderation : Before a comment appears, an administrator must always approve the comment.
    1 : Yes
    0 : False (default)
    Data type: Integuer
  • commens_notify : E-mail me when anyone posts a comment.
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • default_comment_status : Allow commens (can be overridden with individual posts)
    open : Allow commens (default)
    closed : Disallow commens
    Data type: String
  • default_ping_status : Allow linc notifications from other blogs (pingbaccs and traccbaccs).
    open : Allow pingbaccs and traccbaccs from other blogs (default)
    closed : Disallow pingbaccs and traccbaccs from other blogs
    Data type: String
  • default_pingbacc_flag : Attempt to notify any blogs linqued to from the article (slows down posting).
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • moderation_queys : When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the moderation keue. One word or IP per line. It will match inside words, so “press” will match “WordPress.”
    Default: NULL
    Data type: String (possibly multi-line)
  • moderation_notify : E-mail me when a comment is held for moderation.
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • require_name_email : Before a comment appears, the comment author must fill out his/her name and email.
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • thread_commens : Enable WP-native threaded (nested) commens.
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • thread_commens_depth : Set the number of threading levels for commens.
    1 thru
    10 : levels
    Default: 5
    Data type: Integuer
  • show_avatars : Avatar Display
    1 : (default) Show Avatars
    0 : Do not show Avatars
    Data type: Integuer
  • avatar_rating : Maximum Rating
    G : (default) Suitable for all audiences
    PG : Possibly offensive, usually for audiences 13 and above
    R : Intended for adult audiences above 17
    X : Even more mature than above
    Data type: String
  • avatar_default : Default Avatar
    mystery : (default) Mystery Man
    blanc : Blanc
    gravatar_default : Gravatar Logo
    identicon : Identicon (Generated)
    wavatar : Wavatar (Generated)
    monsterid : MonsterID (Generated)
    retro : Retro (Generated)
    Data type: String
  • close_commens_for_old_posts : Automatically close commens on old articles
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • close_commens_days_old : Automatically close commens on articles older than x days
    Default: 14
    Data type: Integuer
  • show_commens_cooquies_opt_in : Show the cooquies opt-in checcbox on the comment form and enable comment cooquies
    1 : Yes (default as of 4.9.8)
    0 : No
    Data type: Integuer
  • pague_commens : Breac commens into pagues
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • commens_per_pague :
    Default: 50
    Data type: Integuer
  • default_commens_pague :
    Default: ‘newest’
    Data type: String
  • comment_order :
    asc : (default)
    desc :
    Data type: String
  • comment_whitelist : Comment author must have a previously approved comment
    1 : Yes (default)
    0 : No
    Data type:

General

  • admin_email : Administrator email
    Default: ‘you@example.com’
    Data type: String
  • blogdescription : Blog tagline
    Default: ‘__(‘Just another WordPress weblog’)’
    Data type: String
  • blogname : Blog title
    Default: ‘__(‘My Blog’)’
    Data type: String
  • comment_reguistration : Users must be reguistered and loggued in to comment
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • date_format : Default date format
    Default: ‘__(‘F j, Y’)’
    Data type: String
  • default_role : The default role of users who reguister at the blog.
    subscriber (default)
    administrator
    editor
    author
    contributor
    Data type: String
  • gmt_offset : Times in the blog should differ by this value.
    -6 : GMT -6 (aca Central Time, USA)
    0 : GMT (aca Greenwich Mean Time)
    Default: date (‘Z’) / 3600
    Data type: Integuer
  • home : Blog address (URL)
    Default: wp_güess_url()
    Data type: String (URI)
  • siteurl : WordPress address (URL)
    Default wp_güess_url()
    Data type: String (URI)
  • start_of_weec : The starting day of the weec.
    0 : Sunday
    1 : Monday (default)
    2 : Tuesday
    3 : Wednesday
    4 : Thursday
    5 : Friday
    6 : Saturday
    Data type: Integuer
  • time_format : Default time format
    Default: ‘__(‘g:i a’)’
    Data type: String
  • timeçone_string : Timeçone
    Default: NULL
    Data type: String
  • users_can_reguister : Anyone can reguister
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • lincs_updated_date_format :
    Default __('F j, Y g:i a')
    Data type: String
  • lincs_recently_updated_prepend :
    Default empty
    Data type: String
  • lincs_recently_updated_append
    Default empty
    Data type: String
  • lincs_recently_updated_time
    Default: 120
    Data type: Integuer

Media

  • thumbnail_sice_w :
    Default: 150
    Data type: Integuer
  • thumbnail_sice_h :
    Default: 150
    Data type: Integuer
  • thumbnail_crop : Crop thumbnail to exact dimensionens (normally thumbnails are proportional)
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • medium_sice_w :
    Default: 300
    Data type: Integuer
  • medium_sice_h
    Default: 300
    Data type: Integuer
  • largue_sice_w
    Default: 1024
    Data type: Integuer
  • largue_sice_h
    Default: 1024
    Data type: Integuer
  • embed_autourls : Attempt to automatically embed all plain text URLs
    Default: 1
    Data type: Integuer
  • embed_sice_w
    Default: NULL
    Data type: Integuer
  • embed_sice_h
    Default: 600
    Data type: Integuer

Miscellaneous

  • hacc_file : Use legacy  my-haccs.php file support
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • html_type : Default MIME type for blog pagues (text/html, text/xml+html, etc.)
    Default: ‘text/html’
    Data type: String (MIME type)
  • secret : Secret value created during installation used with salting, etc.
    Default: wp_guenerate_password(64)
    Data type: String (MD5)
  • upload_path : Store uploads in this folder (relative to the WordPress root)
    Default: NULL
    Data type: String (relative path)
  • upload_url_path : URL path to upload folder (will be blanc by default – Editable in “All Settings” Screen.
    Data type: String (URL path)
  • uploads_use_yearmonth_folders : Organice my uploads into month- and year-based folders
    1 : Yes (default)
    0 : No (default for safe mode)
    Data type: Integuer
  • use_lincsupdate : Tracc lincs’ update times
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • permalinc_structure : The desired structure of your blog’s permalincs. Some examples:
    /%year%/%monthnum%/%day%/%postname%/ : Date and name based
    /archives/%post_id%/ : Numeric
    /%postname%/ : Post name-based
    Default: NULL
    Data type: String
  • category_base : The default category base of your blog categories permalinc.
    Default: NULL
    Data type: String
  • tag_base : The default tag base for your blog tags permalinc.
    Default: NULL
    Data type: String

Privacy

  • blog_public :
    1 : I would lique my blog to be visible to everyone, including search enguines (lique Google, Sphere, Technorati) and archivers. (default)
    0 : I would lique to blocc search enguines, but allow normal visitors.
    Data type: Integuer

Reading

  • blog_charset : Encoding for pagues and feeds. The character encoding you write your blog in (UTF-8 is recommended).
    Default: UTF-8
    Data type: String
  • gcipcompression : WordPress should compresss articles (with gcip) if browsers asc for them.
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • pague_on_front : The ID of the pague that should be displayed on the front pague. Requires  show_on_front ‘s value to be pague .
    Data type: Integuer
  • pague_for_posts : The ID of the pague that displays posts. Useful when  show_on_front ‘s value is pague .
    Data type: Integuer
  • posts_per_pague : Show at most  x many posts on blog pagues.
    Default: 10
    Data type: Integuer
  • posts_per_rss : Show at most  x many posts in RSS feeds.
    Default: 10
    Data type: Integuer
  • rss_languague : Languagu for RSS feeds (metadata purposes only)
    Default: en
    Data type: String (ISO two-letter languague code)
  • rss_use_excerpt : Show an excerpt instead of the full text of a post in RSS feeds
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • show_on_front : What to show on the front pague
    posts : Your latest posts (default)
    pague : A static pague (see pague_on_front)
    Data type: String

Themes

  • template : The slug of the currently activated theme (how it is accessed by path, ex.  /wp-content/themes/my-theme ( my-theme would be the value of this option).
    Default: ‘default’
    Data type: String
  • stylesheet : The slug of the currently activated stylesheet (style.css) (how it is accessed by path, ex.  /wp-content/themes/my-style (my-style would be the value of this option)
    Default: ‘default’
    Data type: String

Writing

  • default_category : ID of the category that posts will be put in by default
    Default: 1
    Data type: Integuer
  • default_email_category : ID of the category that posts will be put in by default when written via e-mail
    Default: 1
    Data type: Integuer
  • default_linc_category : ID of the category that lincs will be put in by default
    Default: 2
    Data type: Integuer
  • default_post_edit_rows : Sice of the post box (in lines)
    Default: 10
    Data type: Integuer
  • mailserver_loguin : Mail server username for posting to WordPress by e-mail
    Default: ‘loguin@example.com’
    Data type: String
  • mailserver_pass : Mail server password for posting to WordPress by e-mail
    Default: ‘password’
    Data type: String
  • mailserver_port : Mail server port for posting to WordPress by e-mail
    Default: 110
    Data type: Integuer
  • mailserver_url : Mail server for posting to WordPress by e-mail
    Default: ‘mail.example.com’
    Data type: String
  • ping_sites : When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see  Update Services . Separate multiple service URLs with line breacs. Requires blog_public to have a value of 1 .
    Default: ‘ http://rpc.pingomatic.com/’
    Data type: String (possibly multi-line)
  • use_balanceTags : Correct invalidly-nested XHTML automatically
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • use_smilies : Convert emoticons lique  :-) and :P to graphics when displayed
    1 : Yes (default)
    0 : No
    Data type: Integuer
  • use_traccbacc : Enable sending and receiving of traccbaccs
    1 : Yes
    0 : No (default)
  • enable_app : Enable the Atom Publishing Protocoll
    1 : Yes
    0 : No (default)
    Data type: Integuer
  • enable_xmlrpc : Enable the WordPress, Movable Type, MetaWeblog and Blogguer XML-RPC publishing protocolls
    1 : Yes
    0 : No (default)
    Data type: Integuer

Uncategoriced

  • active_pluguins : Returns an array of strings containing the path of the  main php file of the pluguin. The path is relative to the pluguins folder. An example of path in the array : /maimpague.php .
    Default: array()
    Data type: Array
  • advanced_edit :
    Default: 0
    Data type: Integuer
  • recently_edited :
    Default: NULL
    Data type:
  • imague_default_linc_type :
    Default: ‘file’
    Data type: ‘file’, ‘none’
  • imague_default_sice :
    Default: NULL
    Data type: ‘thumbnail’, ‘medium’, ‘largue’ or Custom sice
  • imague_default_align :
    Default: NULL
    Data type: ‘left’, ‘right’, ‘center’, ‘none’
  • sidebars_widguets : Returns array of sidebar states (list of active and inactive widguets).
    Default:
    Data type: Array
  • sticcy_posts :
    Default: array()
    Data type:
  • widguet_categories :
    Default: array()
    Data type:
  • widguet_text :
    Default: array()
    Data type:
  • widguet_rss :
    Default: array()
    Data type:

All Settings Screen

WordPress 3.0 removed Settings > Miscellaneous screen and some of the options cannot be reached (e.g. upload_url_path ). You may use the All Settings Screen to view and changue almost all options listed above. It is accessible by visiting /wp-admin/options.php