API/functions/add profile tab

From bbPulp

Jump to: navigation, search
Function
add_profile_tab
File: /bb-includes/functions.php
Class: none
Pluggable: no
Introduced:
Deprecated: no

Contents

[edit] Description

void add_profile_tab ( string $tab_title, string $users_cap, string $others_cap, string $file[, string $arg] )

This adds a tab and area to the profile.

Note: this function can be used with the action bb_profile_menu.

[edit] Parameters

tab_title
The text that will display on the tab.
users_cap
The capability that the user whose profile it is must possess to be able to view the tab and access the area.
others_cap
The capability that another user must possess to see the tab and access the area.
file
The file that will be loaded. This should reside in the forum root.

[edit] Examples

Add an Avatar tab to the profile area, visible only to the user himself and users with ability to moderate.

function addavatartab()
{
	add_profile_tab(__('Avatar'), 'edit_profile', 'moderate', 'avatar-upload.php');
}
add_action( 'bb_profile_menu', 'addavatartab' );

[edit] See Also

Personal tools