0
登録フォームのユーザーのために、自分の役割(管理者を除く)を選択するためのドロップダウンを追加する方法を探しています。 現在、buddypress 2.8.0。でwordpress 4.7.4を実行していますが、スニペットなどが見つかりましたが、実際には動作していません。WPの登録にロールを追加
すべてのヘルプは非常にあなたはユーザー-role.php fileandを作成する必要が
登録フォームのユーザーのために、自分の役割(管理者を除く)を選択するためのドロップダウンを追加する方法を探しています。 現在、buddypress 2.8.0。でwordpress 4.7.4を実行していますが、スニペットなどが見つかりましたが、実際には動作していません。WPの登録にロールを追加
すべてのヘルプは非常にあなたはユーザー-role.php fileandを作成する必要が
はのfunctions.phpファイルに含める認識されます。
<?php
if(get_role('subscriber')){
remove_role('subscriber');
}
if(get_role('client')){
remove_role('client');
}
// Add a Country (Others) role
$result = add_role('country', __(
'Country (Others)'),
array(
'read' => true, // true allows this capability
'edit_posts' => true, // Allows user to edit their own posts
'edit_pages' => true, // Allows user to edit pages
'edit_others_posts' => true, // Allows user to edit others posts not just their own
'create_posts' => true, // Allows user to create new posts
'manage_categories' => true, // Allows user to manage post categories
'publish_posts' => true, // Allows the user to publish, otherwise posts stays in draft mode
'edit_themes' => false, // false denies this capability. User can’t edit your theme
'install_plugins' => false, // User cant add new plugins
'update_plugin' => false, // User can’t update any plugins
'update_core' => false // user cant perform core updates
)
);
これまでのところ、新しいwp/bpバージョンhttps://wordpress.org/plugins/wp-roles-at-registration/で動作する1年前のプラグインが見つかりました。 – Nec