admin管理员组文章数量:1130349
In my project I want to make a new menu position which will be actually a copy of 'Users' page but with some additional filters/modifications. For example as a result I need to have another menu position above users called "Admins" which will show exactly same structured page but with only Admin users. It is for better/easier user experience for my client.
My question is how to do this? I know that there are functions like add_menu_page but using them like this (users.php as identifier):
add_menu_page( 'custom menu title', 'custom menu', 'users.php', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
results in two menu positions which collapse and expand together, and I wanted them to work independently. I can also show content based on function but I don't know if there is any way to easily output content of whole users.php page?
In my project I want to make a new menu position which will be actually a copy of 'Users' page but with some additional filters/modifications. For example as a result I need to have another menu position above users called "Admins" which will show exactly same structured page but with only Admin users. It is for better/easier user experience for my client.
My question is how to do this? I know that there are functions like add_menu_page but using them like this (users.php as identifier):
add_menu_page( 'custom menu title', 'custom menu', 'users.php', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
results in two menu positions which collapse and expand together, and I wanted them to work independently. I can also show content based on function but I don't know if there is any way to easily output content of whole users.php page?
Share Improve this question edited Jul 6, 2015 at 10:49 Subharanjan 1,5891 gold badge17 silver badges29 bronze badges asked Jul 6, 2015 at 10:02 labm0nkeylabm0nkey 2161 silver badge3 bronze badges 2 |1 Answer
Reset to default 0After some further research I have used WP_List_Table class for this. I had to add buttons and links myself to make it look like users.php but it wasn't much of work.
In my project I want to make a new menu position which will be actually a copy of 'Users' page but with some additional filters/modifications. For example as a result I need to have another menu position above users called "Admins" which will show exactly same structured page but with only Admin users. It is for better/easier user experience for my client.
My question is how to do this? I know that there are functions like add_menu_page but using them like this (users.php as identifier):
add_menu_page( 'custom menu title', 'custom menu', 'users.php', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
results in two menu positions which collapse and expand together, and I wanted them to work independently. I can also show content based on function but I don't know if there is any way to easily output content of whole users.php page?
In my project I want to make a new menu position which will be actually a copy of 'Users' page but with some additional filters/modifications. For example as a result I need to have another menu position above users called "Admins" which will show exactly same structured page but with only Admin users. It is for better/easier user experience for my client.
My question is how to do this? I know that there are functions like add_menu_page but using them like this (users.php as identifier):
add_menu_page( 'custom menu title', 'custom menu', 'users.php', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
results in two menu positions which collapse and expand together, and I wanted them to work independently. I can also show content based on function but I don't know if there is any way to easily output content of whole users.php page?
Share Improve this question edited Jul 6, 2015 at 10:49 Subharanjan 1,5891 gold badge17 silver badges29 bronze badges asked Jul 6, 2015 at 10:02 labm0nkeylabm0nkey 2161 silver badge3 bronze badges 2-
Why do you need two
users.phppages? – s_ha_dum Commented Jul 6, 2015 at 14:37 - As I said it is for my client and that's just how he wanted it to be. The question here is not 'why' but 'how'. – labm0nkey Commented Jul 6, 2015 at 16:06
1 Answer
Reset to default 0After some further research I have used WP_List_Table class for this. I had to add buttons and links myself to make it look like users.php but it wasn't much of work.
本文标签: Cloning admin pages like usersphp
版权声明:本文标题:Cloning admin pages like users.php 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749060985a2310097.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


users.phppages? – s_ha_dum Commented Jul 6, 2015 at 14:37