bbp_register_repair_tool( array $args = array() )

Register an admin area repair tool


Description Description


Parameters Parameters

$args

(Optional)

Default value: array()


Top ↑

Return Return

()


Top ↑

Source Source

File: includes/admin/tools.php

function bbp_register_repair_tool( $args = array() ) {

	// Parse arguments
	$r = bbp_parse_args( $args, array(
		'id'          => '',
		'type'        => '',
		'title'       => '',
		'description' => '',
		'callback'    => '',
		'priority'    => 0,
		'overhead'    => 'low',
		'version'     => '',
		'components'  => array(),

		// @todo
		'success'     => esc_html__( 'The repair was completed successfully', 'bbpress' ),
		'failure'     => esc_html__( 'The repair was not successful',         'bbpress' )
	), 'register_repair_tool' );

	// Bail if missing required values
	if ( empty( $r['id'] ) || empty( $r['priority'] ) || empty( $r['title'] ) || empty( $r['callback'] ) ) {
		return;
	}

	// Add tool to the registered tools array
	bbp_admin()->tools[ $r['id'] ] = array(
		'type'        => $r['type'],
		'title'       => $r['title'],
		'description' => $r['description'],
		'priority'    => $r['priority'],
		'callback'    => $r['callback'],
		'overhead'    => $r['overhead'],
		'components'  => $r['components'],
		'version'     => $r['version'],

		// @todo
		'success'     => $r['success'],
		'failure'     => $r['failure'],
	);
}

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.