我試圖在注冊過程中添加多個(gè)角色,除了添加多個(gè)用戶角色外,一切正常。我使用的代碼:$roles = array('wholesale_customer', 'retail_customer');$userdata = array( 'user_login' => $username, 'user_email' => $email, 'user_pass' => $password, 'user_url' => $website, 'first_name' => $first_name, 'last_name' => $last_name, 'nickname' => $nickname, 'description' => $bio, 'role' => $roles // want to add multiple roles such as editor,retailer);$user = wp_insert_user( $userdata );
如何在注冊時(shí)在wordpress中添加多個(gè)角色
繁星點(diǎn)點(diǎn)滴滴
2023-03-11 16:36:07