bbp_get_admin_link( mixed $args = '' )
Return the link to the admin section
Description
Parameters
- $args
-
(Optional) This function supports these arguments: - text: The text - before: Before the lnk - after: After the link
Default value: ''
Return
(The) link
Source
File: bp-forums/users/template.php
function bbp_get_admin_link( $args = '' ) {
if ( !current_user_can( 'moderate' ) )
return;
if ( !empty( $args ) && is_string( $args ) && ( false === strpos( $args, '=' ) ) )
$args = array( 'text' => $args );
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'text' => __( 'Admin', 'buddyboss' ),
'before' => '',
'after' => ''
), 'get_admin_link' );
$retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after'];
return apply_filters( 'bbp_get_admin_link', $retval, $r );
}
Changelog
| Version | Description |
|---|---|
| bbPress (r2827) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.