<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][9127] trunk/src: Improve the way Group's Manage tabs are generated</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/9127">9127</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/9127","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-11-07 23:31:26 +0000 (Fri, 07 Nov 2014)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Improve the way Group's Manage tabs are generated
In {{{BP_Group_Extension->setup_edit_hooks()}}} method, we are now using the {{{bp_core_new_subnav_item()}}} function to generate the Group's manage tab sub navigation.
The action {{{'groups_admin_tabs'}}} is no more used. However for back compatibility reasons, we will keep on catching this hook inviting the user using a {{{_doing_it_wrong}}} message to now use the BuddyPress Group Extension API instead.
props boonebgorges
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/5994">#5994</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcoretemplatephp">trunk/src/bp-core/bp-core-template.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupsclassesphp">trunk/src/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupsloaderphp">trunk/src/bp-groups/bp-groups-loader.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupstemplatephp">trunk/src/bp-groups/bp-groups-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcorebpcoretemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-template.php 2014-11-07 15:54:51 UTC (rev 9126)
+++ trunk/src/bp-core/bp-core-template.php 2014-11-07 23:31:26 UTC (rev 9127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,12 +26,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses bp_get_user_nav() Renders the navigation for a profile of a currently
</span><span class="cx" style="display: block; padding: 0 10px"> * viewed user.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function bp_get_options_nav() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function bp_get_options_nav( $parent_slug = '' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $bp = buddypress();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If we are looking at a member profile, then the we can use the current
</span><span class="cx" style="display: block; padding: 0 10px"> // component as an index. Otherwise we need to use the component's root_slug
</span><span class="cx" style="display: block; padding: 0 10px"> $component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $selected_item = bp_current_action();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! bp_is_single_item() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,10 +41,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $the_index = $component_index;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( !isset( $bp->bp_options_nav[bp_current_item()] ) || count( $bp->bp_options_nav[bp_current_item()] ) < 1 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current_item = bp_current_item();
+
+ if ( ! empty( $parent_slug ) ) {
+ $current_item = $parent_slug;
+ $selected_item = bp_action_variable( 0 );
+ }
+
+ if ( !isset( $bp->bp_options_nav[$current_item] ) || count( $bp->bp_options_nav[$current_item] ) < 1 ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $the_index = bp_current_item();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $the_index = $current_item;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If the current action or an action variable matches the nav item id, then add a highlight CSS class.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $subnav_item['slug'] == bp_current_action() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $subnav_item['slug'] == $selected_item ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $selected = ' class="current selected"';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $selected = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $list_type = bp_is_group() ? 'groups' : 'personal';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // echo out the final list item
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item, $selected_item );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1917,7 +1925,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $retval ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $retval = bp_is_groups_component() && groups_get_current_group();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return (bool) $retval;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-classes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-classes.php 2014-11-07 15:54:51 UTC (rev 9126)
+++ trunk/src/bp-groups/bp-groups-classes.php 2014-11-07 23:31:26 UTC (rev 9127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3637,6 +3637,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since BuddyPress (1.8.0)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function setup_edit_hooks() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Bail if not in a group
+ if ( ! bp_is_group() ) {
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bail if not an edit screen
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_screen_enabled( 'edit' ) || ! bp_is_item_admin() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3646,16 +3650,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = $this->screens['edit'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $position = isset( $screen['position'] ) ? (int) $screen['position'] : 10;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $position += 40;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Add the tab
- // @todo BP should be using bp_core_new_subnav_item()
- add_action( 'groups_admin_tabs', create_function( '$current, $group_slug',
- '$selected = "";
- if ( "' . esc_attr( $screen['slug'] ) . '" == $current )
- $selected = " class=\"current\"";
- echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $screen['slug'] ) ) . '\">' . esc_attr( $screen['name'] ) . '</a></li>";'
- ), $position, 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current_group = groups_get_current_group();
+ $admin_link = trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add the tab to the manage navigation
+ bp_core_new_subnav_item( array(
+ 'name' => $screen['name'],
+ 'slug' => $screen['slug'],
+ 'parent_slug' => $current_group->slug . '_manage',
+ 'parent_url' => trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' ),
+ 'user_has_access' => bp_is_item_admin(),
+ 'position' => $position,
+ 'screen_function' => 'groups_screen_group_admin',
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Catch the edit screen and forward it to the plugin template
</span><span class="cx" style="display: block; padding: 0 10px"> if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $screen['slug'], 0 ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->call_edit_screen_save( $this->group_id );
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupsloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-loader.php 2014-11-07 15:54:51 UTC (rev 9126)
+++ trunk/src/bp-groups/bp-groups-loader.php 2014-11-07 23:31:26 UTC (rev 9127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,6 +509,59 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If viewing an admin page, create the group admin subnav items
+ if ( bp_is_group_admin_page() ) {
+ $admin_link = trailingslashit( $group_link . 'admin' );
+
+ // Common params to all nav items
+ $default_params = array(
+ 'parent_url' => $admin_link,
+ 'parent_slug' => $this->current_group->slug . '_manage',
+ 'screen_function' => 'groups_screen_group_admin',
+ 'user_has_access' => bp_is_item_admin(),
+ );
+
+ $sub_nav[] = array_merge( array(
+ 'name' => __( 'Details', 'buddypress' ),
+ 'slug' => 'edit-details',
+ 'position' => 0,
+ ), $default_params );
+
+ $sub_nav[] = array_merge( array(
+ 'name' => __( 'Settings', 'buddypress' ),
+ 'slug' => 'group-settings',
+ 'position' => 10,
+ ), $default_params );
+
+ if ( ! (int) bp_get_option( 'bp-disable-avatar-uploads' ) && buddypress()->avatar->show_avatars ) {
+ $sub_nav[] = array_merge( array(
+ 'name' => __( 'Photo', 'buddypress' ),
+ 'slug' => 'group-avatar',
+ 'position' => 20,
+ ), $default_params );
+ }
+
+ $sub_nav[] = array_merge( array(
+ 'name' => __( 'Members', 'buddypress' ),
+ 'slug' => 'manage-members',
+ 'position' => 30,
+ ), $default_params );
+
+ if ( 'private' == $this->current_group->status ) {
+ $sub_nav[] = array_merge( array(
+ 'name' => __( 'Requests', 'buddypress' ),
+ 'slug' => 'membership-requests',
+ 'position' => 40,
+ ), $default_params );
+ }
+
+ $sub_nav[] = array_merge( array(
+ 'name' => __( 'Delete', 'buddypress' ),
+ 'slug' => 'delete-group',
+ 'position' => 1000,
+ ), $default_params );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> parent::setup_nav( $main_nav, $sub_nav );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-template.php 2014-11-07 15:54:51 UTC (rev 9126)
+++ trunk/src/bp-groups/bp-groups-template.php 2014-11-07 23:31:26 UTC (rev 9127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2299,38 +2299,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $current_tab = bp_get_group_current_admin_tab();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $css_id = 'manage-members';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( bp_is_item_admin() ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'private' == $group->status ) {
+ $css_id = 'membership-requests';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( "bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bp_get_options_nav( $group->slug . '_manage' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( ! bp_is_item_admin() )
- return false; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ remove_filter( "bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3 );
+}
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * BackCompat for plugins/themes directly hooking groups_admin_tabs
+ * without using the Groups Extension API
+ *
+ * @param string $subnav_output subnav item output
+ * @param string $subnav_item subnav item params
+ * @param string $selected_item current selected tab
+ * @return string HTML output
+ */
+function bp_group_admin_tabs_backcompat( $subnav_output = '', $subnav_item = '', $selected_item = '' ) {
+ if ( ! has_action( 'groups_admin_tabs' ) ) {
+ return $subnav_output;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && buddypress()->avatar->show_avatars ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $group = groups_get_current_group();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Photo', 'buddypress' ); ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ob_start();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'groups_admin_tabs', $selected_item, $group->slug );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members' ) ?>"><?php _e( 'Members', 'buddypress' ); ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $admin_tabs_backcompat = trim( ob_get_contents() );
+ ob_end_clean();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( $groups_template->group->status == 'private' ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $admin_tabs_backcompat ) ) {
+ _doing_it_wrong( "do_action( 'groups_admin_tabs' )", __( 'This action should not be used directly. Please use the BuddyPress Group Extension API to generate Manage tabs.', 'buddypress' ), '2.2.0' );
+ $subnav_output .= $admin_tabs_backcompat;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
-
- <?php endif; ?>
-
- <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
-
- <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
-
-<?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $subnav_output;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre>
</div>
</div>
</body>
</html>