Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/27/2011 09:15:35 PM (16 years ago)
Author:
johnjamesjacoby
Message:

First pass at replacing the 'Admin Options' menus for users and groups. Include additional functionality for moderating registered components and their associated data. Also introduce cap checks for allowing non-super-admins to have moderator abilities. Does not include action handlers, this is a first pass at getting the UI in place. Also adds button class to a few rogue links in the groups component.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-template.php

    r3930 r3955  
    984984add_action( 'bp_head', 'bp_members_activity_feed' );
    985985
     986
     987function bp_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
     988        echo bp_get_members_component_link( $component, $action, $query_args, $nonce );
     989}
     990        function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
     991                global $bp;
     992
     993                // Must be displayed user
     994                if ( empty( $bp->displayed_user->id ) )
     995                        return;
     996
     997                // Append $action to $url if there is no $type
     998                if ( !empty( $action ) )
     999                        $url = $bp->displayed_user->domain . $bp->{$component}->slug . '/' . $action;
     1000                else
     1001                        $url = $bp->displayed_user->domain . $bp->{$component}->slug;
     1002
     1003                // Add a slash at the end of our user url
     1004                $url = trailingslashit( $url );
     1005
     1006                // Add possible query arg
     1007                if ( !empty( $query_args ) && is_array( $query_args ) )
     1008                        $url = add_query_arg( $query_args, $url );
     1009
     1010                // To nonce, or not to nonce...
     1011                if ( true === $nonce )
     1012                        $url = wp_nonce_url( $url );
     1013                elseif ( is_string( $nonce ) )
     1014                        $url = wp_nonce_url( $url, $nonce );
     1015
     1016                // Return the url, if there is one
     1017                if ( !empty( $url ) )
     1018                        return $url;
     1019        }
     1020
    9861021?>
Note: See TracChangeset for help on using the changeset viewer.