admin管理员组文章数量:1201203
I'm building a plugin that contains a simple editor for a particular file format. This will only be accessible in the admin menu's for the plugin, no frontend access. I've started looking at the actual editor layout and it needs some more real estate on the admin side, so I want to hide the admin menu panels. It would also be cleaner and reduce any unnecessary clutter, like the Gutenberg editor, or the customise theme page. Here's a few options that I'm thinking of:
- I could make the editor completely full screen and have a "back to WordPress" button to go back to admin screen
- It could work equally well to hide the left admin menu and leave in the top bar, although this would be a waste of space on mobile.
Are there any built in WordPress functions that hide the admin menu? I think my preferred way to add the editor is to use the add_submenu_page() so that it has it's own page in the menu. However I don't know if there are any standard methods to hide the default admin menu panels on a particular page?
Otherwise I could create the editor in it's own standalone file that the user visits but then I'll have to add a lot of WordPress functions such as checking that the user is logged in, and providing standard WordPress functionality.
I want all the code to be contained within the plugin, so I don't want to edit any pages in wp-admin.
I'm building a plugin that contains a simple editor for a particular file format. This will only be accessible in the admin menu's for the plugin, no frontend access. I've started looking at the actual editor layout and it needs some more real estate on the admin side, so I want to hide the admin menu panels. It would also be cleaner and reduce any unnecessary clutter, like the Gutenberg editor, or the customise theme page. Here's a few options that I'm thinking of:
- I could make the editor completely full screen and have a "back to WordPress" button to go back to admin screen
- It could work equally well to hide the left admin menu and leave in the top bar, although this would be a waste of space on mobile.
Are there any built in WordPress functions that hide the admin menu? I think my preferred way to add the editor is to use the add_submenu_page() so that it has it's own page in the menu. However I don't know if there are any standard methods to hide the default admin menu panels on a particular page?
Otherwise I could create the editor in it's own standalone file that the user visits but then I'll have to add a lot of WordPress functions such as checking that the user is logged in, and providing standard WordPress functionality.
I want all the code to be contained within the plugin, so I don't want to edit any pages in wp-admin.
Share Improve this question asked Jun 15, 2022 at 9:02 AutoBakerAutoBaker 1602 silver badges11 bronze badges 1- 1 There's no built-in function to You will need to use JavaScript (or, any jQuery fullscreen library) to trigger the browser's fullscreen mode. To hide the unnecessary elements, you can toggle a class to the body. – Abhik Commented Jun 15, 2022 at 9:16
1 Answer
Reset to default 0Per the comments, it doesn't seem there is anything built in for this. I included this code in my page to hide the admin menus:
<style>
#adminmenumain, #wpadminbar {
display: none;
}
</style>
You'll have to muck about with CSS to get your page right. But it seems to work ok.
本文标签: How to make an admin plugin menu page go full screen
版权声明:本文标题:How to make an admin plugin menu page go full screen? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738541389a2095560.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论