Skip to content

amnestywebsite/cmb2-message-field

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

License

Unknown, GPL-2.0 licenses found

Licenses found

Unknown
LICENSE.md
GPL-2.0
LICENSE.txt

Code of conduct

Security policy

Stars

Watchers

Forks

Languages