bbp_get_admin_link

Return the link to the admin section.

Description

bbp_get_admin_link( (string) $args = '' ); 

Parameters (1)

0. $args — Optional. (string) => ''
This function supports these arguments: - text: The text - before: Before the lnk - after: After the link

Usage

  1. if ( !function_exists( 'bbp_get_admin_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/users/template.php'; 
  3. $args = ''; 
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_get_admin_link($args); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/users/template.php  
  1. function bbp_get_admin_link( $args = '' ) { 
  2. if ( !current_user_can( 'moderate' ) ) 
  3. return; 
  4.  
  5. if ( !empty( $args ) && is_string( $args ) && ( false === strpos( $args, '=' ) ) ) 
  6. $args = array( 'text' => $args ); 
  7.  
  8. // Parse arguments against default values 
  9. $r = bbp_parse_args( $args, array( 
  10. 'text' => __( 'Admin', bbpress ),  
  11. 'before' => '',  
  12. 'after' => '' 
  13. ), 'get_admin_link' ); 
  14.  
  15. $retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after']; 
  16.  
  17. return apply_filters( 'bbp_get_admin_link', $retval, $r );