PHPackages                             ralfhortt/wp-meta-box - 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. ralfhortt/wp-meta-box

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

ralfhortt/wp-meta-box
=====================

A WordPress meta box helper

3.0(5y ago)01702MITPHP

Since Nov 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Horttcore/wp-meta-box)[ Packagist](https://packagist.org/packages/ralfhortt/wp-meta-box)[ RSS](/packages/ralfhortt-wp-meta-box/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (3)Used By (2)

WordPress Meta Box Helper
=========================

[](#wordpress-meta-box-helper)

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

[](#installation)

`$ composer require ralfhortt/wp-meta-box`

Usage
-----

[](#usage)

- Extend `RalfHortt\MetaBoxes\MetaBox()`
- You *MUST* set `$this->identifier`, `$this->name`, `$this->screen` in the class constructor
- You *CAN* set the additional variables `$this->context`, `$this->priority`, `$this->callbackArgs`
- You *MUST* Add a `render()` method
- You *CAN* add a `save()` method
- A nonce is added automatically and checked

Extend
------

[](#extend)

### Action

[](#action)

- `do_action("before-meta-box-{$this->identifier}", $post, $callbackArgs)`
- `do_action("after-meta-box-{$this->identifier}", $post, $callbackArgs)`
- `do_action("saved-meta-box-{$this->identifier}", $postId, $post, $update)`

Example
-------

[](#example)

```
