PHPackages                             felixarntz/wp-global-options - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. felixarntz/wp-global-options

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

felixarntz/wp-global-options
============================

Implements a global option storage in WordPress.

1.0.0-beta.1(8y ago)8511GPL-2.0-or-laterPHP

Since Feb 21Pushed 8y ago2 watchersCompare

[ Source](https://github.com/felixarntz/wp-global-options)[ Packagist](https://packagist.org/packages/felixarntz/wp-global-options)[ Docs](https://github.com/felixarntz/wp-global-options)[ RSS](/packages/felixarntz-wp-global-options/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/0548f8123da5c010dbdd7333d1858828e805322f18b6530304aa1b799e065c4b/68747470733a2f2f6170692e7472617669732d63692e6f72672f66656c697861726e747a2f77702d676c6f62616c2d6f7074696f6e732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/felixarntz/wp-global-options)[![Latest Stable Version](https://camo.githubusercontent.com/46d7949d555259dfa09eb7bc0556bb9d1d7c1cb0277db3f140025537b99a2e6c/68747470733a2f2f706f7365722e707567782e6f72672f66656c697861726e747a2f77702d676c6f62616c2d6f7074696f6e732f76657273696f6e)](https://packagist.org/packages/felixarntz/wp-global-options)[![License](https://camo.githubusercontent.com/a96e642d64c2502472711c73638785b4fb921829b6334332130c5a220c28f813/68747470733a2f2f706f7365722e707567782e6f72672f66656c697861726e747a2f77702d676c6f62616c2d6f7074696f6e732f6c6963656e7365)](https://packagist.org/packages/felixarntz/wp-global-options)

WP Global Options
=================

[](#wp-global-options)

Implements a global option storage in WordPress.

What it does
------------

[](#what-it-does)

- introduces a database table `global_options`
- introduces a CRUD API for global options, including sanitization and validation
- introduces a CRUD API for global transients
- introduces an API for registering/unregistering global settings
- includes a `wp global-options` command for WP-CLI

How to install
--------------

[](#how-to-install)

The plugin can either be installed as a network-wide regular plugin or alternatively as a must-use plugin.

Recommendations
---------------

[](#recommendations)

- While it is a best practice to prefix plugin functions and classes, this plugin is a proof-of-concept for WordPress core, and several functions may end up there eventually. This plugin only prefixes functions and classes that are specific to the plugin, internal helper functions for itself or hooks. Non-prefixed functions and classes are wrapped in a conditional so that, if WordPress core adapts them, their core variant will be loaded instead. Therefore, do not define any of the following functions or classes:
    - `sanitize_global_option()`
    - `get_global_option()`
    - `update_global_option()`
    - `add_global_option()`
    - `delete_global_option()`
    - `wp_load_global_alloptions()`
    - `get_global_transient()`
    - `set_global_transient()`
    - `delete_global_transient()`
    - `register_global_setting()`
    - `unregister_global_setting()`
    - `get_registered_global_settings()`
    - `filter_default_global_option()`

Usage
-----

[](#usage)

### Managing Global Options

[](#managing-global-options)

- Function: `get_global_option( string $option, mixed $default = false ): mixed`
- Function: `update_global_option( string $option, mixed $value, string|bool $autoload = null ): bool`
- Function: `add_global_option( string $option, mixed $value, string|bool $autoload = 'no' ): bool`
- Function: `delete_global_option( string $option ): bool`

### Managing Global Transients

[](#managing-global-transients)

- Function: `get_global_transient( string $transient ): mixed`
- Function: `set_global_transient( string $transient, mixed $value, int $expiration = 0 ): bool`
- Function: `delete_global_transient( string $transient ): bool`

### Managing Global Settings

[](#managing-global-settings)

- Function: `register_global_setting( string $option_group, string $option_name, array $args = array() )`
- Function: `unregister_global_setting( string $option_group, string $option_name )`
- Function: `get_registered_global_settings()`

### Hooks

[](#hooks)

- Filter: `sanitize_global_option_{$option}`
- Filter: `validate_global_option_{$option}`
- Filter: `pre_global_option_{$option}`
- Filter: `default_global_option_{$option}`
- Filter: `global_option_{$option}`
- Filter: `pre_update_global_option_{$option}`
- Filter: `pre_update_global_option`
- Filter: `pre_global_transient_{$transient}`
- Filter: `global_transient_{$transient}`
- Filter: `pre_set_global_transient_{$transient}`
- Filter: `expiration_of_global_transient_{$transient}`
- Action: `update_global_option`
- Action: `update_global_option_{$option}`
- Action: `updated_global_option`
- Action: `add_global_option`
- Action: `add_global_option_{$option}`
- Action: `added_global_option`
- Action: `pre_delete_global_option_{$option}`
- Action: `delete_global_option_{$option}`
- Action: `deleted_global_option`
- Action: `set_global_transient_{$transient}`
- Action: `setted_global_transient`
- Action: `delete_global_transient_{$transient}`
- Action: `deleted_global_transient`

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3051d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a60abe9a2c42fe5cf2117b88aac2eab186f0ea3c969f1f4a29d4a09d831153b8?d=identicon)[felixarntz](/maintainers/felixarntz)

---

Tags

multisitenetworkswordpress-pluginpluginwordpressmultisiteglobalmultinetworkglobal options

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/felixarntz-wp-global-options/health.svg)

```
[![Health](https://phpackages.com/badges/felixarntz-wp-global-options/health.svg)](https://phpackages.com/packages/felixarntz-wp-global-options)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[bueltge/wordpress-multisite-enhancements

Enhance Multisite for Network Admins with different topics

1123.6k](/packages/bueltge-wordpress-multisite-enhancements)[iceicetimmy/acf-post-type-selector

Post type selector for Advanced Custom Fields.

559.0k](/packages/iceicetimmy-acf-post-type-selector)[devaloka/network-wp-query

A WordPress plugin that provides Network-wide WP Query for Multisite environment

161.3k](/packages/devaloka-network-wp-query)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
