beans_render_function_array

Calls function given by the first parameter and passes the remaining parameters as arguments.

The main purpose of this function is to store the content echoed by a function in a variable.

beans_render_function_array( callback $callback, array $params = array() )

Return: (string) The callback content.

Parameters

NameTypeRequiredDefaultDescription
$callbackcallbacktrue-The callback to be called.
$paramsarrayfalsearray()The parameters to be passed to the callback, as an indexed array.

Source

function beans_render_function_array( $callback, $params = array() ) {

	if ( ! is_callable( $callback ) ) {
		return;
	}

	ob_start();

		call_user_func_array( $callback, $params );

	return ob_get_clean();

}