Setting the argument public
to true
will do. Check out the file wp-admin/includes/media.php
, function get_compat_media_markup()
for reference:
if ( $args['in_modal'] ) {
foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
$t = (array) get_taxonomy( $taxonomy );
if ( ! $t['public'] || ! $t['show_ui'] ) {
continue;
}