bbp_admin_tools_box()

Output a bbPress specific tools box


Description Description


Source Source

File: includes/admin/tools.php

function bbp_admin_tools_box() {

	// Bail if user cannot access tools page
	if ( ! current_user_can( 'bbp_tools_page' ) ) {
		return;
	}

	// Get the tools pages
	$links = array();
	$tools = bbp_get_tools_admin_pages(); ?>

	<div class="card">
		<h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ) ?></h3>
		<p><?php esc_html_e( 'bbPress provides the following tools to help you manage your forums:', 'bbpress' ); ?></p>

		<?php

		// Loop through tools and create links
		foreach ( $tools as $tool ) {

			// Skip if user cannot see this page
			if ( ! current_user_can( $tool['cap'] ) ) {
				continue;
			}

			// Add link to array
			$links[] = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array( 'page' => $tool['page'] ), admin_url( 'tools.php' ) ) ), $tool['name'] );
		}

		// Output links
		echo '<p class="bbp-tools-links">' . implode( ' &middot; ', $links ) . '</p>';

	?></div>

<?php
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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