Custom field for CMB2.
// Classic CMB2 declaration
$cmb = new_cmb2_box( array(
'id' => 'prefix-metabox-id',
'title' => __( 'Title', 'textdomain' ),
'object_types' => array( 'post', ), // Post type
) );
// Add new field
$cmb->add_field( array(
'name' => __( 'Select Icon', 'textdomain' ),
'id' => 'prefix_icon',
'type' => 'fontawesome_icon', // This field type
) );
This plugin uses the following jquery plugin