PHPackages                             phpnomad/wordpress-integration - 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. phpnomad/wordpress-integration

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpnomad/wordpress-integration
==============================

4.3.3(3w ago)14432MITPHPPHP &gt;=8.0CI passing

Since May 21Pushed 3w ago2 watchersCompare

[ Source](https://github.com/phpnomad/wordpress-integration)[ Packagist](https://packagist.org/packages/phpnomad/wordpress-integration)[ Docs](https://github.com/phpnomad/core)[ RSS](/packages/phpnomad-wordpress-integration/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (82)Versions (33)Used By (2)

phpnomad/wordpress-integration
==============================

[](#phpnomadwordpress-integration)

[![Latest Version](https://camo.githubusercontent.com/85ed42308a6aac542e661c3553c2131919c2838d839f41396aa89a1860b69b21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f776f726470726573732d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/wordpress-integration)[![Total Downloads](https://camo.githubusercontent.com/e942affc9104cf8fff5aa2e3592c32495a44d0055575995e377e1bf492743949/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f776f726470726573732d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/wordpress-integration)[![PHP Version](https://camo.githubusercontent.com/5e430a9e7bca80bf9769f06186e63d666758acf47e5f15b5739752b13b315a8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f776f726470726573732d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/wordpress-integration)[![License](https://camo.githubusercontent.com/7c5c38c3bb49548b7b7cbb4e4da3d3258fdfcdfca0e81c030f34f58792257ac5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f776f726470726573732d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/wordpress-integration)

Integrates WordPress with PHPNomad's strategy interfaces. This package maps core PHPNomad abstractions (events, cache, database, REST, tasks, auth, email, HTTP, console, templates, translation) onto WordPress core APIs so application code written against PHPNomad interfaces runs inside a plugin or theme without touching WordPress functions directly.

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

[](#installation)

```
composer require phpnomad/wordpress-integration
```

Composer will pull the PHPNomad packages this integration depends on as transitive installs, along with Action Scheduler for background task dispatch.

What This Provides
------------------

[](#what-this-provides)

- `WordPressInitializer` wires every strategy below into the DI container, gates loading on WordPress 6.3.0 or higher, and binds WordPress actions like `wp_login`, `wp_logout`, `user_register`, `deleted_user`, `set_current_user`, `parse_request`, and `wp` to PHPNomad's auth, datastore, and framework events.
- Event bridging through `EventStrategy` (broadcasts as `do_action('phpnomad/' . $eventId)` and attaches through `add_action`) and `ActionBindingStrategy` for mapping arbitrary WordPress actions onto PHPNomad event classes.
- Cache backed by the WordPress object cache: `ObjectCacheStrategy` over `wp_cache_*`, `CachePolicy`, and `WordPressObjectCacheIdempotencyStore` for task deduplication.
- Database through `wpdb`: `QueryStrategy`, `QueryBuilder`, `ClauseBuilder`, and `TableCreateStrategy`/`TableUpdateStrategy`/`TableDeleteStrategy`/`TableExistsStrategy` for schema operations, plus `DatabaseProvider` supplying prefix, charset, collation, and default TTL.
- Auth and users: `User` wraps `WP_User`, `CurrentUserResolverStrategy` returns the current user, `HashStrategy` and `PasswordResetStrategy` handle credentials, `LoginUrlProvider` exposes the login URL, and `ActionToCapabilityAdapter` maps PHPNomad actions onto WordPress capabilities.
- REST through the WordPress REST API: `RestStrategy` dispatches PHPNomad controllers with middleware, validation, and interceptors, backed by `Request` and `Response` wrappers around `WP_REST_Request` and `WP_REST_Response`.
- Tasks through Action Scheduler: `WordPressTaskStrategy` dispatches PHPNomad tasks and `WordPressTaskHandlerRegistry` registers handlers against Action Scheduler's hooks.
- Transport: `FetchStrategy` runs HTTP requests through `wp_remote_request`, and `EmailStrategy` sends through `wp_mail`.
- Console through WP-CLI: `ConsoleStrategy` registers PHPNomad commands and routes I/O through `Input` and `ConsoleOutputStrategy`.
- Templates, assets, translation, mutation, and privacy: `PhpEngine` renders PHP templates, `AssetStrategy` resolves plugin URLs, `TranslationStrategy` delegates to WordPress gettext, `MutationStrategy` wraps `apply_filters`, and `TrackingPermissionStrategy` supplies consent information.

Requirements
------------

[](#requirements)

- WordPress 6.3.0 or higher
- The PHPNomad packages this integration adapts (`phpnomad/auth`, `phpnomad/cache`, `phpnomad/db`, `phpnomad/datastore`, `phpnomad/event`, `phpnomad/rest`, `phpnomad/http`, `phpnomad/fetch`, `phpnomad/tasks`, `phpnomad/console`, `phpnomad/asset`, `phpnomad/email`, `phpnomad/template`, `phpnomad/translate`, `phpnomad/privacy`, `phpnomad/framework`, `phpnomad/loader`), all installed automatically by Composer
- `woocommerce/action-scheduler` for task dispatch, also installed automatically

Usage
-----

[](#usage)

Compose `WordPressInitializer` into a `Bootstrapper` alongside `CoreInitializer` and your own application initializer. A minimal plugin bootstrap looks like this:

```
