PHPackages                             pixelplugin/wp-container-api - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. pixelplugin/wp-container-api

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

pixelplugin/wp-container-api
============================

WordPress Container API

v2.0.2(2y ago)08MITPHPPHP &gt;=8.0

Since Oct 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pixelpluginhq/wp-container-api)[ Packagist](https://packagist.org/packages/pixelplugin/wp-container-api)[ Docs](https://pixelplugin.com)[ RSS](/packages/pixelplugin-wp-container-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

WordPress Container API
=======================

[](#wordpress-container-api)

`pixelplugin/wp-container-api` is a composer package that provides global functions for working with a global dependency container in WordPress.

Installation
------------

[](#installation)

```
composer require pixelplugin/wp-container-api
```

Usage
-----

[](#usage)

You need this package and some WordPress plugin that provides a global PSR-compatible container instance in `$wp_container` variable, for example [pixelplugin/wp-container](https://github.com/pixelpluginhq/wp-container). Then you can use the following functions to work with the container from your code.

Functions
---------

[](#functions)

### wp\_container\_get

[](#wp_container_get)

`wp_container_get(string $id): mixed` is used to get a value from the global container instance.

```
$value = wp_container_get(ClassName::class);
```

### wp\_container\_has

[](#wp_container_has)

`wp_container_has(string $id): bool` checks if a value exists in the global container instance.

```
if (wp_container_has(ClassName::class)) {
    // ClassName exists in the container.
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~3 days

Total

5

Last Release

917d ago

Major Versions

v1.0.1 → v2.02023-10-31

PHP version history (3 changes)v1.0PHP ^7.0

v1.0.1PHP ^7.2

v2.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/61c0097fcc89b74e8282515f2a4e611fab0ebdd9390b5e92cf6fb3814b13ff50?d=identicon)[pixelplugin](/maintainers/pixelplugin)

---

Top Contributors

[![pixelpluginhq](https://avatars.githubusercontent.com/u/148715416?v=4)](https://github.com/pixelpluginhq "pixelpluginhq (21 commits)")

---

Tags

composercontainercontainer-interfacedependency-injectionphppsrpsr-11wordpresspsrcontainerPSR-11container-interfacewordpressdependency-injectiondi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pixelplugin-wp-container-api/health.svg)

```
[![Health](https://phpackages.com/badges/pixelplugin-wp-container-api/health.svg)](https://phpackages.com/packages/pixelplugin-wp-container-api)
```

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[slince/di

A flexible dependency injection container

20260.4k6](/packages/slince-di)

PHPackages © 2026

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