PHPackages                             jascha030/wp-plugin-lib - 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. jascha030/wp-plugin-lib

ActiveLibrary

jascha030/wp-plugin-lib
=======================

Classes for Wordpress Plugin Development using more modern PHP and more OOP.

1.5.1(4y ago)078[1 PRs](https://github.com/jascha030/wp-plugin-lib/pulls)MITPHPCI failing

Since Feb 21Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/jascha030/wp-plugin-lib)[ Packagist](https://packagist.org/packages/jascha030/wp-plugin-lib)[ RSS](/packages/jascha030-wp-plugin-lib/feed)WikiDiscussions main Synced 1w ago

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

WP Plugin Library for OOP
=========================

[](#wp-plugin-library-for-oop)

A backbone for utilizing the [Wordpress Plugin API](https://codex.wordpress.org/Plugin_API#Introduction), using `php@7.4` and OOP.

Getting started
---------------

[](#getting-started)

Prerequisites
-------------

[](#prerequisites)

- Php `^7.4.*`
- Composer `^2`
- WordPress &gt;= 5.5.0

### Installation

[](#installation)

```
composer require jascha030/wp-plugin-lib
```

Usage
-----

[](#usage)

The easiest way to explain usage is with an example of the main plugin file.

The name of the package might be deceiving, Plugin refers to the WP Plugin API, which means that it can be used for either a plugin or a theme. In this example we pretend to be building a plugin, but for a theme we would just write our code in the theme's `functions.php` file instead of the main plugin file.

`main-plugin-file.php`

```
