PHPackages                             onepix/wordpress-stubs - 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. onepix/wordpress-stubs

ActiveLibrary

onepix/wordpress-stubs
======================

WordPress function and class declaration stubs for static analysis.

v6.8.1(12mo ago)07875MITPHP

Since Nov 25Pushed 12mo agoCompare

[ Source](https://github.com/0zd0/wordpress-stubs)[ Packagist](https://packagist.org/packages/onepix/wordpress-stubs)[ Docs](https://github.com/0zd0/wordpress-stubs)[ RSS](/packages/onepix-wordpress-stubs/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelogDependencies (6)Versions (6)Used By (5)

WordPress Stubs
===============

[](#wordpress-stubs)

It provides stub declarations for [WordPress](https://wordpress.org/)core functions, classes, interfaces, globals, hooks. These stubs can help plugin and theme developers leverage static analysis tools like [PHPStan](https://github.com/phpstan/phpstan).

The stubs are generated from [@johnpbloch's package](https://github.com/johnpbloch/wordpress-core)using [onepix/wordpress-stubs-generator](https://github.com/0zd0/wordpress-stubs-generator).

### Requirements

[](#requirements)

- PHP 8.1+

### Installation

[](#installation)

Require this package as a development dependency with [Composer](https://getcomposer.org).

```
composer require --dev onepix/wordpress-stubs
```

Alternatively you may download `wordpress-stubs.phpstub` directly.

### Usage with PHPStan

[](#usage-with-phpstan)

```
composer require --dev szepeviktor/phpstan-wordpress
```

The package [`szepeviktor/phpstan-wordpress`](https://github.com/szepeviktor/phpstan-wordpress)depends on [`phpstan/phpstan`](http://github.com/phpstan/phpstan) and this one. Please do read [that package's README](https://github.com/szepeviktor/phpstan-wordpress/blob/master/README.md)and see the `example` directory over there.

### Usage with Psalm

[](#usage-with-psalm)

Update your Psalm config to include this section.

```

```

```

```

Furthermore ensure WordPress core is *not* included in ``.

### Usage in Intellisense

[](#usage-in-intellisense)

If your IDE has trouble parsing all of WordPress you may find the stubs useful for enabling code completion and related features. For example there are [instructions](https://github.com/bmewburn/vscode-intelephense/issues/113)for usage with VSCode's [Intelephense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client)extension.

### Versioning

[](#versioning)

This package is versioned to match the WordPress version from which the stubs are generated.

### Generating stubs for a different WordPress version

[](#generating-stubs-for-a-different-wordpress-version)

1. Run modern PHP version
2. Clone this repository and `cd` into it
3. Update `"johnpbloch/wordpress": "x.x.x"` in `source/composer.json` with the desired version
4. Run `composer update`
5. And run `./generate.sh`

The `wordpress-stubs.phpstub` file should now be updated.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.7% 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 ~45 days

Total

4

Last Release

363d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/380c3a3697647ffa6dacfa3f41ef2d8ea43a40a12a823d380b843b57ac14750c?d=identicon)[onepix](/maintainers/onepix)

![](https://www.gravatar.com/avatar/7f618d5c06c711c1eada5b9569aad7cee6d81e830566775e7734dd87828e8fdc?d=identicon)[0zd0](/maintainers/0zd0)

---

Top Contributors

[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (305 commits)")[![IanDelMar](https://avatars.githubusercontent.com/u/42134098?v=4)](https://github.com/IanDelMar "IanDelMar (111 commits)")[![johnbillion](https://avatars.githubusercontent.com/u/208434?v=4)](https://github.com/johnbillion "johnbillion (71 commits)")[![0zd0](https://avatars.githubusercontent.com/u/67220210?v=4)](https://github.com/0zd0 "0zd0 (24 commits)")[![GiacoCorsiglia](https://avatars.githubusercontent.com/u/15148404?v=4)](https://github.com/GiacoCorsiglia "GiacoCorsiglia (22 commits)")[![herndlm](https://avatars.githubusercontent.com/u/5738896?v=4)](https://github.com/herndlm "herndlm (10 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (10 commits)")[![lipemat](https://avatars.githubusercontent.com/u/1688181?v=4)](https://github.com/lipemat "lipemat (7 commits)")[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (5 commits)")[![gin0115](https://avatars.githubusercontent.com/u/28779094?v=4)](https://github.com/gin0115 "gin0115 (1 commits)")[![MocioF](https://avatars.githubusercontent.com/u/26635356?v=4)](https://github.com/MocioF "MocioF (1 commits)")[![janw-me](https://avatars.githubusercontent.com/u/1026882?v=4)](https://github.com/janw-me "janw-me (1 commits)")

---

Tags

PHPStanwordpressstatic analysispsalm

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/onepix-wordpress-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/onepix-wordpress-stubs/health.svg)](https://phpackages.com/packages/onepix-wordpress-stubs)
```

###  Alternatives

[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3287.8M898](/packages/szepeviktor-phpstan-wordpress)[php-stubs/wordpress-stubs

WordPress function and class declaration stubs for static analysis.

19513.0M263](/packages/php-stubs-wordpress-stubs)[php-stubs/woocommerce-stubs

WooCommerce function and class declaration stubs for static analysis.

942.9M66](/packages/php-stubs-woocommerce-stubs)[php-stubs/acf-pro-stubs

Advanced Custom Fields PRO stubs for static analysis.

73692.8k50](/packages/php-stubs-acf-pro-stubs)[php-stubs/wp-cli-stubs

WP-CLI function and class declaration stubs for static analysis.

302.3M79](/packages/php-stubs-wp-cli-stubs)[php-stubs/wordpress-globals

Global variables and global constants from WordPress core.

13799.0k17](/packages/php-stubs-wordpress-globals)

PHPackages © 2026

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