PHP code example of ralfhortt / wp-meta-box

1. Go to this page and download the library: Download ralfhortt/wp-meta-box library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ralfhortt / wp-meta-box example snippets



use RalfHortt\MetaBoxes\MetaBox;

class MyMetaBox extends MetaBox
{
	
	public function __construct()
	{
		$this->identifier = 'my-meta-box';
		$this->name = __('My Meta Box', 'textdomain');
		$this->screen = ['post'];
		$this->context = 'side';
		$this->priority = 'high';
	}

	protected function render(\WP_Post $post, array $callbackArgs): void
	{