How to make a simple conditional check
-
I’ve manually re-created the bp_get_options_nav because it’s a too dynamic and clunky piece of code.
Now I’ve made a simple HTML nav-list of each group component and added some PHP code between to print the ‘bp_group_permalink’ / [component-name] / but I only need to find a way to check IF a user can moderator this current group or is admin, if thats TRUE –> print the HTML list of the [admin component ] IF FALSE do nothing and hide this HTML list.
I would like to have the same conditional statement for the [ send-ivites ] component that checks if a user can invite friends because he’s logged-in + member of this group.
<nav class="item-list-tabs no-ajax nav-centered"> <ul class="button-group radius"> <li><a class="button" href=""><i class="fi fi-root-groups"></i></a></li> <li><a class="button" href="<?php bp_group_permalink(); ?>"><i class="fi fi-home"></i></a></li> <li><a class="button" href="<?php bp_group_permalink(); ?>members/">Members</a></li> <li class="group-btn-select item-list-tabs no-ajax"> <ul> /*** select filter stuff here ***/ </ul> </li> <li><a class="button" href="<?php bp_group_permalink(); ?>send-invites/"><i class="fi fi-megaphone"></i></a></li> <?php do_action( 'bp_group_options_nav' ); ?> <li><a class="button" href="<?php bp_group_permalink(); ?>admin/edit-details/"><i class="fi fi-wrench"></i></a></li> <li><a class="button" href="<?php bp_group_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><i class="fi fi-rss"></i></a></li> </ul> </nav>
How can I make those conditionals on list number 5 and 6.
Thanks.
- The topic ‘How to make a simple conditional check’ is closed to new replies.