*/ class UsersWP_User_Types { public static function get_register_forms() { $register_forms = (array) uwp_get_option( 'multiple_registration_forms', array() ); return $register_forms; } /** * Output the user types list or edit form. * * @param string $tab Current tab. */ public static function output( string $tab = '' ) { do_action( 'uwp_user_types_start' ); if ( isset( $_GET['form'] ) ) { self::output_edit_form( $_GET['form'] ); } else { self::display_table(); } } /** * Output the edit form for a user type. */ private static function output_edit_form( $form_type ) { if ( $form_type === 'add' ) { self::display_add_form(); } else { self::display_edit_form(); } } /** * Display the 'add' user type form. */ private static function display_add_form() { $all_pages = wp_list_pluck( get_pages(), 'post_title', 'ID' ); $user_roles = uwp_get_user_roles(); $registration_form_actions = uwp_get_registration_form_actions(); $current_role = get_option( 'default_role' ); // Remove admin role unset( $user_roles['administrator'] ); ?>