WP Manifestindependent plugin directory
manifest / developer / cmb2-message-field

CMB2 Message Field

Add a "message" field to CMB2 to allow rendering of arbitrary text in the settings form

★ 0stars
523release downloads
v1.0.0latest · 2 years ago

Install

Download cmb2-message-field.zip From the v1.0.0 release on GitHub, Feb 28, 2024

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/amnestywebsite/cmb2-message-field/releases/download/v1.0.0/cmb2-message-field.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This plugin adds support for an informative message field to CMB2.

Usage

See the CMB2 Wiki for information on how to use CMB2.

This field supports HTML markup. By default, all output will be escaped using wp_kses with the 'post' context.
You can specify a different context by passing a value to the 'kses' key.

The message data will be wrapped in a <div> tag. You can declare attributes for this wrapper by passing an associative array of key=>value pairs in the 'attributes' key.

$metabox->add_field(
    [
        'id'         => 'my-message',
        'type'       => 'message',
        'message'    => sprintf( '<p>%s</p>', __( 'My Message', 'textdomain' ) ),
        'kses'       => 'post',
        'attributes' => [
            'class' => 'my-message-field',
        ],
    ]
);

Releases

1 release. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.0.0 latest
Feb 28, 2024 2 years ago
cmb2-message-field.zip
523