bbp_get_admin_link( array $args = array() )

Return the link to the admin section


Description Description


Parameters Parameters

$args

(Optional) This function supports these arguments: - text: The text - before: Before the lnk - after: After the link

Default value: array()


Top ↑

Return Return

(The) link


Top ↑

Source Source

File: includes/users/template.php

	function bbp_get_admin_link( $args = array() ) {

		// Bail if user cannot globally moderate
		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'   => esc_html__( 'Admin', 'bbpress' ),
			'before' => '',
			'after'  => ''
		), 'get_admin_link' );

		$retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after'];

		// Filter & return
		return apply_filters( 'bbp_get_admin_link', $retval, $r, $args );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.