06/22/2016 at 3:57 pm
#380363
Keymaster
@ ottomek
Hmmm… there is actually no way to do this presently. If you change the code snippet to this:
// Register the metabox and field.
add_action( 'cn_metabox', 'cn_register_custom_metabox_and_date_field' );
function cn_register_custom_metabox_and_date_field() {
$atts = array(
'title' => 'Expiration Date', // Change this to a name which applies to your project.
'id' => 'expiration_date_metabox', // Change this so it is unique to you project.
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'name' => 'Date', // Change this field name to something which applies to you project.
'show_label' => TRUE, // Whether or not to display the 'name'. Changing it to false will suppress the name.
'id' => 'expiration_date', // Change this so it is unique to you project. Each field id MUST be unique.
'type' => 'datepicker', // This is the field type being added.
'readonly' => is_admin() && ! current_user_can( 'manage_options' ) ? TRUE : FALSE
),
),
);
cnMetaboxAPI::add( $atts );
}
And make these changes to Connections ../includes/class.metabox-api.php file, it will work the way you want. I’ve already made the change and it’ll included in the next update.
Hope that helps!
