I am working on a system for time / partial timers using Wordpress. To do this, I create a new custom publication type EMPLOYEE, and for this I need 2 corresponding users AGENT and CUSTOMER:
- The AGENT user can create and edit their own EMPLOYEE (s), but not edit the EMPLOYEE (s) of other AGENT (s).
- You can view and comment on the message EMPLOYEE for all AGENTS, CUSTOMERS and the general public,
- which also implies that the CUSTOMER user can only view all EMPLOYEE messages.
- The CUSTOMER user must be separated from the general public, because as soon as they hire EMPLOYEE, the system needs to associate them with EMPLOYEE, so CUSTOMER must be a registered user.
- Finally, both AGENT and CUSTOMER users can create / edit their own user profiles in Word and WordPress format with their combination of username and password.
How to do it? The online documentation of users and features made me pull my hair and run in circles. So far, a custom type record has been registered here, and I'm currently setting up meta fields for other information for this message type:
register_post_type( 'employee', array( 'labels' => array( 'name' => __('Employees','tdom'), 'singular_name' => __('Employee','tdom'), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Employee' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Employee' ), 'new_item' => __( 'New Employee' ), 'view' => __( 'View Employee' ), 'view_item' => __( 'View Employee' ), 'search_items' => __( 'Search Employees' ), 'not_found' => __( 'No Employees found' ), 'not_found_in_trash' => __( 'No Employees found in Trash' ), 'parent' => __( 'Parent Employee' ) ), 'public' => true, 'show_ui' => true, 'query_var' => true, 'menu_icon' => get_stylesheet_directory_uri() . '/images/emp_icon.png', 'menu_position' => 4, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => true, 'supports' => array('title', 'thumbnail', 'author') ) );
I met the Justin Tadlock Members plugin (very popular on Google and forums), but I was hoping that my requirements are simple enough not to use the plugin anymore. It is also too much to wrap my head.
Reference. Thanks in advance.
Ana ban
source share