0

I have a question concerning creating a new user. I’m creating a plugin for this wp site I am working on. I have set up custom roles for these and I’d like to have a separate menu item for the “Owner” role to be able to access and add new staff members. I’d use the add users menu but I’d like to customize it to say “Staff” and “Add New Staff” but I can’t do that, I don’t think. So, I’ve opted for this route. Anyway… I’ve tried copying over the context of the “user-new.php” and “users.php” and change paths but I continue to run into errors. I’ve tried copying over stuff viewing the source but that hasn’t worked either. I’d like pretty much the same exact setup… maybe excluding “Administrator” role from the options. Any pointers on this would be greatly appreciated. Thank you in advance to anyone that can help!

EDIT:

I have my core file with an include require_once 'includes/plugin_hooks.php'; Then in my plugin_hooks.php I have this written out:

/Eleven34 Studios Staff Manager Menu

function e34s_staff_plugin_menu() {
add_menu_page(‘Staff’,’Staff’,’read’,’e34s-staff’,’e34s_staff_list’,
‘/wordpress/wp-content/plugins/e34s_time_card/includes/images/e34s_staff_icon.png’,22);
}

function e34s_staff_list() {
include (‘staff/staff.php’);
}

add_action(‘admin_menu’,’e34s_staff_plugin_menu’);

//Submenu items
function e34s_staff_plugin_add_staff() {
add_submenu_page( ‘e34s-staff’, ‘Add Staff’, ‘Add Staff’, ‘read’, ‘e34s_staff_add_staff’, ‘e34s_staff_add_staff_callback’ );
}

function e34s_staff_add_staff_callback() {
include (‘staff/add_staff.php’);
}

add_action(‘admin_menu’, ‘e34s_staff_plugin_add_staff’);

 

Then after the user is added successfully I want it to redirect to the staff page that lists all of the staff members.

 

###############################################

 

important: The code posted below is not fully tested. There are lots of area where you can improve the code as this is only to show you the right way. If you need any pointer, check user-new.php as the reference.

I am going to use the class structure for the plugin and let’s say plugin name is create-user. So, the basic structure of this plugin will be:

 

I am going to use the class structure for the plugin and let’s say plugin name is create-user. So, the basic structure of this plugin will be:

 

 

<?php
/*
Plugin Name: Create User
Description: Create user
Plugin URI: ****
Author: sakibmoon
Author URI: ****
Version: 0.0.1
*/
class  create_user{

}