beans_output

Register output by ID.

The output can be modified using the available Beans HTML “output” functions.

HTML comments containing the ID are added before and after the output if the development mode is enabled. This makes it very easy to find a content ID when inspecting an element in your web browser.

Since this function uses beans_apply_filters(), the $id argument may contain sub-hook(s).

beans_output( string $id, string $output )

Return: (string) The output.

Parameters

NameTypeRequiredDefaultDescription
$idstringtrue-A unique string used as a reference. The $id argument may contain sub-hook(s).
$outputstringtrue-Content to output.
$varmixedtrue-Additional variables passed to the functions hooked to $id.

Source

function beans_output( $id, $output ) {

	$args = func_get_args();
	$args[0] = $id . '_output';

	$output = call_user_func_array( 'beans_apply_filters', $args );

	if ( empty( $output ) ) {
		return;
	}

	if ( _beans_is_html_dev_mode() ) {
		$output = "<!-- open output: $id -->" . $output . "<!-- close output: $id -->";
	}

	return $output;

}