PHPackages                             wp-plus/wp-oop-base - 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. wp-plus/wp-oop-base

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

wp-plus/wp-oop-base
===================

Opinionated OOP base for WordPress plugin and theme development.

v2.0.1(6mo ago)049MITPHPPHP ^8.0

Since Apr 11Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/wp-plus/wp-oop-base)[ Packagist](https://packagist.org/packages/wp-plus/wp-oop-base)[ RSS](/packages/wp-plus-wp-oop-base/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

WP OOP Base
===========

[](#wp-oop-base)

An opinionated object-oriented base library for WordPress plugin and theme development, providing a structured foundation for building maintainable WordPress extensions.

Overview
--------

[](#overview)

WP OOP Base offers a collection of abstract classes and interfaces that promote clean, object-oriented architecture in WordPress development. It provides standardized patterns for common WordPress functionality including plugins, hooks, shortcodes, custom post types, and taxonomies.

Features
--------

[](#features)

- **Plugin Architecture**: Singleton-based plugin classes with extensible sub-plugin support
- **Hook Management**: Object-oriented wrapper for WordPress actions and filters
- **Shortcode Framework**: Structured approach to shortcode development with attribute validation
- **Custom Post Types &amp; Taxonomies**: Abstract classes for registering custom content types
- **Helper Utilities**: Common WordPress development utilities
- **Clean Architecture**: Structured patterns for maintainable code organization
- **PSR-4 Autoloading**: Modern PHP autoloading standards

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

[](#requirements)

- PHP 8.0 or higher
- WordPress 6.5 or higher (for development)

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

[](#installation)

### Via Composer

[](#via-composer)

```
composer require wp-plus/wp-oop-base
```

When installed via Composer, the library is automatically loaded through Composer's autoloader and doesn't need to be placed in the WordPress plugins directory. Simply include Composer's autoloader in your project and the classes will be available.

Note: this will work only if Composer's autoloader is included - either manually or using a tool like [composer-autoload for WordPress](https://packagist.org/packages/wp-plus/composer-autoload).

### Manual Installation

[](#manual-installation)

1. Download the library
2. Place it in your `wp-content/plugins/wp-oop-base/` directory
3. Activate the plugin through the WordPress admin

#### Must-Use Plugin Installation

[](#must-use-plugin-installation)

For must-use plugin functionality (automatically loaded, before regular plugins):

1. Follow the manual installation steps above
2. Move `wp-oop-base.php` to `wp-content/mu-plugins/`
3. Keep all other files in `wp-content/plugins/wp-oop-base/`

The bootstrap file will automatically detect the correct paths whether it's running as a regular plugin or must-use plugin.

Quick Start
-----------

[](#quick-start)

### Creating a Plugin

[](#creating-a-plugin)

```
