bb_get_logout_link
The BuddyPress bb get logout link function.
Description
bb_get_logout_link( (string) $args = '' );
Parameters (1)
- 0. $args — Optional. (string) =>
''
- The args.
Usage
if ( !function_exists( 'bb_get_logout_link' ) ) { require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; } // The args. $args = ''; // NOTICE! Understand what this does before running. $result = bb_get_logout_link($args);
Defined (1)
The function is defined in the following location(s).
- /bp-forums/bbpress/bb-includes/functions.bb-template.php
- function bb_get_logout_link( $args = '' ) {
- if ( $args && is_string($args) && false === strpos($args, '=') )
- $args = array( 'text' => $args );
- $defaults = array('text' => __('Log Out'), 'before' => '', 'after' => '', 'redirect' => '');
- $args = wp_parse_args( $args, $defaults );
- extract($args, EXTR_SKIP);
- $query = array( 'action' => 'logout' );
- if ( $redirect ) {
- $query['redirect_to'] = $redirect;
- }
- $uri = esc_attr( bb_get_uri('bb-login.php', $query, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS) );
- return apply_filters( 'bb_get_logout_link', $before . '<a href="' . $uri . '">' . $text . '</a>' . $after, $args );
- }