I have created a new page in admin. I need to show all the users in this page(like Users admin page).
The reason for this is because i want to show certain custom user roles only on this page.
I tried using WP_List_Table
but no luck in figuring out on how to implement.
This is the function i have, i need to put the code inside here.
add_action( 'admin_menu', 'cypolicy_users_admin_menu' );
function cypolicy_users_admin_page_contents()
{
echo "<h1>" . esc_html_e( 'CyPolicy Users', 'cypolicy-users-plugin-textdomain' ) . "</h1>";
}
Can someone kindly guide me.
/wp-admin/users.php?role=editor
wouldn't adding that as a menu in the sidebar under users also solve the problem this is trying to resolve?WP_List_Table
and brand new pages aren't necessaryadd_menu_page( 'Google', 'Google', 'edit_posts', 'https://google.com', '', 'dashicons-admin-home', 1);
, nothing stops you doing this with the role filters, and it's 1000x easier than what you're trying to do (and unlike your proposed solution it's compatible with plugins etc)