上述解决方案不起作用(返回错误500),但此解决方案起作用:
add_action(\'admin_head\', \'leave_only_publish_button\');
function leave_only_publish_button() {
if( !current_user_can(\'activate_plugins\') ) { //doesn\'t affect users who can activate plugins, remove if needed
echo \'<style>
#misc-publishing-actions, #minor-publishing-actions {
display:none;
}
</style>\';
}
}