最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Enable all Screen Options by default

matteradmin8PV0评论

I am currently hiding the screen options tab on a post edit screen with this function...

add_filter('screen_options_show_screen', 'remove_screen_options');
function remove_screen_options(){
    return current_user_can( 'manage_options' );
}

This is working well, but if somebody has previously disabled a screen option then it is missing and they have no way of bringing it back.

Is there a way to force all screen options to be checked for all users?

I am currently hiding the screen options tab on a post edit screen with this function...

add_filter('screen_options_show_screen', 'remove_screen_options');
function remove_screen_options(){
    return current_user_can( 'manage_options' );
}

This is working well, but if somebody has previously disabled a screen option then it is missing and they have no way of bringing it back.

Is there a way to force all screen options to be checked for all users?

Share Improve this question asked Mar 28, 2019 at 11:43 fightstarr20fightstarr20 1,1358 gold badges26 silver badges47 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

These are only hidden via CSS, so enqueing your own admin CSS via admin_enqueue_scripts hook to display them should fix it.

body.js.wp-admin.wp-core-ui  #wpbody .hide-if-js {
  display: block;
}

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far