Skip to content

CMB2 Message Field

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',
        ],
    ]
);

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages