Trying to hide some elements “actions” from the “Add Media” window. the thing is, I need to hide those actions in a specific post type
Tried the following snippet, of course not working
<?php
add_action( 'wp_head', function () { ?>
<style>
.media-menu-item #menu-item-featured-image {
display: none;
}
</style>
<?php } );
Advertisement
Answer
The only mistake is that the id “menu-item-featured-image” is not a child for the class “media-menu-item”, but it is the same element
so just delete the space between “.media-menu-item” and “#menu-item-featured-image”
.media-menu-item#menu-item-featured-image {
display: none;
}


