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
Name | Type | Required | Default | Description |
---|---|---|---|---|
$callback | callback | true | - | The callback to be called. |
$params | array | false | array() | 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();
}