Want more features on Pastebin? Sign Up, it's FREE!
Guest

Buddypress add admin links to group

By: a guest on Aug 12th, 2010  |  syntax: PHP  |  size: 1.46 KB  |  views: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //
  2. // add helpful admin links to the group admin display
  3. //
  4. function scg_add_admin_links_to_group_avatar( $avatar ) {
  5.         global $bp;
  6.        
  7.         if ( !is_site_admin() ) // only show these links for the site admin
  8.                 return;
  9.                
  10.         echo '<style type="text/css"> .my-admin-link { padding-left: 64px; font-size: 11px; color:#999; clear:both; } .single-item .my-admin-link { padding-left: 0; margin-top:5px; float: right; } </style>';
  11.         echo '<div class="my-admin-link">';
  12.  
  13.         if ( !$bp->is_single_item ) {
  14.                 echo 'Quick Links: ';
  15.                 echo '<a href="'.bp_get_group_permalink().'forum">forum</a> | ';
  16.                 echo '<a href="'.bp_get_group_permalink().'members">members</a> | ';
  17.                
  18.                 if (function_exists('invite_anyone_init'))
  19.                         echo '<a href="'.bp_get_group_permalink().'invite-anyone">invites</a> | ';
  20.                 else
  21.                         echo '<a href="'.bp_get_group_permalink().'send-invites">invites</a> | ';
  22.         }
  23.        
  24.         echo 'Admin: ';
  25.         echo '<a href="'.bp_get_group_permalink().'admin">details</a>';
  26.         echo ' | <a href="'.bp_get_group_permalink().'admin/group-settings">settings</a>';
  27.         //echo ' | <a href="'.bp_get_group_permalink().'admin/group-avatar">avatar</a>';
  28.         echo ' | <a href="'.bp_get_group_permalink().'admin/manage-members">members</a>';
  29.         echo ' | <a href="'.bp_get_group_permalink().'admin/delete-group">delete</a>';
  30.         echo '</div>';
  31. }
  32. add_filter( 'bp_directory_groups_item', 'scg_add_admin_links_to_group_avatar', 20 );
  33. add_filter( 'bp_before_group_header_meta', 'scg_add_admin_links_to_group_avatar', 20 );
clone this paste RAW Paste Data