All Courses > Up and Running > Chapters > Mastering the Options API in WordPress

Mastering the Options API in WordPress

Key Takeaways:

Each WordPress site contains many sitewide options—from the site's time zone setting to a user-controlled footer background color. Each of these site options is stored as a simple key-value pair inside the wp_options table (note that the wp_ prefix can change) of the WordPress database.
WordPress's Options API is a simple interface for accessing, updating, and deleting sitewide options.
get_option(), update_option(), and delete_option() are the three functions needed to work with site options. update_option() covers both adding new options and updating existing options.

WordPress developers commonly need to record and change small pieces of sitewide data. These pieces of data are known as site options (or, sometimes, "site settings"). Examples could include:

Retrieve the URL of the site's custom header logo
Set a custom background color across the site