Hello!
I was using media modal support but now it seems that it does not work. I tested it in a localhost website and it does not work. This is my code
/***********************************************************************
* B. ADD CUSTOM META BOXES
* *********************************************************************/
function colours_meta_boxes( $meta_boxes ) {
$prefix = 'colours_';
// attachment
$meta_boxes[] = array(
'title' => esc_html__( 'Artist Info', 'colours-of-a-journey-plugin' ),
'post_types' => 'attachment',
'media_modal' => true,
'fields' => array(
array(
'name' => esc_html__( 'Nickname', 'colours-of-a-journey-plugin' ),
'id' => $prefix . 'attachment_nickname',
'type' => 'text',
),
array(
'name' => esc_html__( 'Age', 'colours-of-a-journey-plugin' ),
'id' => $prefix . 'attachment_age',
'type' => 'number',
),
array(
'name' => esc_html__( 'Category', 'colours-of-a-journey-plugin' ),
'id' => $prefix . 'attachment_theme_tag',
'type' => 'select',
'options' => array(
'sel' => esc_html__( 'Select', 'colours-of-a-journey-plugin' ),
'past' => esc_html__( 'Past', 'colours-of-a-journey-plugin' ),
'present' => esc_html__( 'Present', 'colours-of-a-journey-plugin' ),
'future' => esc_html__( 'Future', 'colours-of-a-journey-plugin' ),
),
),
array(
'id' => $prefix . 'attachment_painting',
'type' => 'hidden',
),
array(
'id' => $prefix . 'attachment_gallery',
'type' => 'hidden',
),
array(
'id' => $prefix . 'attachment_structure',
'type' => 'hidden',
),
),
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'colours_meta_boxes' );
If I change the post type to post it works, but if I have the post type to attachment, I cannot see the custom meta boxes in the media modal window.
Any ideas?
Thank you 🙂