WP Manifestindependent plugin directory
manifest / content / cmb2-dashicon-radio

CMB2 Dashicon Radio Field

https://github.com/modemlooper/cmb2-dashicon-radio

by modemlooper · github.com/modemlooper/cmb2-dashicon-radio

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/modemlooper/cmb2-dashicon-radio/archive/refs/heads/master.zip

Readme

Dashicon Radio CMB2 Field

Radio value is dashicon class.

function cmb2_dashicon_radio_metabox() {

    $prefix = 'yourprefix_demo_';

    $cmb = new_cmb2_box( array(
        'id'            => $prefix . 'metabox',
        'title'         => __( 'Test Metabox', 'cmb2' ),
        'object_types'  => array( 'page', 'post' ), // Post type
        // 'show_on_cb' => 'yourprefix_show_if_front_page', // function should return a bool value
        // 'context'    => 'normal',
        // 'priority'   => 'high',
        // 'show_names' => true, // Show field names on the left
        // 'cmb_styles' => false, // false to disable the CMB stylesheet
        // 'closed'     => true, // true to keep the metabox closed by default
    ) );

    $cmb->add_field( array(
        'name'             => __( 'Dashicon', 'cmb2' ),
        'desc'             => __( 'field description (optional)', 'cmb2' ),
        'id'               => $prefix . 'dashicon',
        'type'             => 'dashicon_radio',     
    ) );

}
dd_action( 'cmb2_admin_init', 'cmb2_dashicon_radio_metabox' );

Screenshots

Image

Read the full README on GitHub →