doxn43207 2015-08-08 21:14
浏览 68

如何在buddypress中编辑非管理员用户的组创建步骤

In my buddypress setup, I have the groups component enabled. I also have the bp docs, bbpress, invite anyone plugins installed.

Currently when I create a group regardless who I am logged in as, I get prompt the following steps in the following order:

  1. group-details
  2. group-settings
  3. forum
  4. resources
  5. invite anyone

I would like to preserve all these steps for the admin keymaster users but I would like to disable the forum and resources steps. How can I achieve this?

I have attempted to use the following code at the top of the create.php within the groups directory:

global $bp;
if(!bbp_is_user_keymaster()){
    unset( $bp->groups->group_creation_steps['forum'] );
    unset( $bp->groups->group_creation_steps['resources'] );
}

Unfortunately this code doesn't work so well as the page still redirects to the forum step after group-settings. The forum page does appear to be empty with back and next buttons being visible. If click on the next button, I get a page error and if I click on the back button, I get redirected to the invite-anyone step.

  • 写回答

1条回答 默认 最新

  • dongque4778 2015-08-08 22:22
    关注

    You need to take a look at do_action( 'groups_custom_create_steps' ); and actually use remove_action();. You will need to investigate the functions/methods that are used and hooked on groups_custom_create_steps. Thus you will be able to remove empty screens of steps as well.

    Also, it's better to place your code into bp-custom.php, and not in theme files.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?