Appearance
How to Hide Instant Share/Publish Now Metabox For Non-Admins
Hiding the Instant sharing metabox for non-admins can be done with some simple custom PHP code added to the functions.php file of your child theme. Note: this method applies to the Classic Editor only. If you are using the block editor (Gutenberg), the Instant Sharing panel appears in the plugin sidebar and is not affected by this code. If you'd like to do this yourself, the code is displayed below, we have however gone ahead and packed it into a little plugin for you which you can download here:
DIY code
function rop_hide_instant_sharing_metabox(){
if( !current_user_can('manage_options') ){
echo '<style>
#rop_publish_now_metabox{
display: none;
}
</style>';
}
}
add_action('admin_head', 'rop_hide_instant_sharing_metabox');