Control: Callback - 10quality/wpmvc-addon-metaboxer GitHub Wiki

The control used a field type to output and render custom HTML.

Usage

See example:

class Post extends Model
{
    // Class properties and methods...

    protected function init()
    {
        $this->metaboxes = [
            'metabox_id' => [
                'tabs' => [
                    'tab_id' => [
                        'fields' => [

                            uniqid() => [
                                'type' => 'callback',
                                'callback' => function( $settings_model, $field_id ) {
                                    echo '<p>Custom HTML rendering.</p>';
                                    echo '<pre style="background-color: #444444;color: #fff;padding: 10px;overflow: auto;">';
                                    print_r( $settings_model );
                                    echo '</pre>';
                                },
                            ],

                        ],
                    ],
                ],
            ],
        ];
    }
}
⚠️ **GitHub.com Fallback** ⚠️