Register self-close markup and attributes by ID.

This function is shortuct of beans_open_markup(). It should be used for self-closed HTML markup such as images or inputs.

beans_selfclose_markup( string $id, string|bool $tag, string|array $attributes = array() )

Return: (string) The output.


$idstringtrue-A unique string used as a reference. The $id argument may contain sub-hook(s).
$tagstring|booltrue-The HTML self-close tag.If set to False or empty, the markup HTML tag will be removed but the actions hook will be called. If set the Null, both markup HTML tag and actions hooks will be removed.
$attributesstring|arrayfalsearray()Query string or array of attributes. The array key defines the attribute name and the array value defines the attribute value. Setting the array value to '' will display the attribute value as empty (e.g. class=""). Setting it to 'false' will only display the attribute name (e.g. data-example). Setting it to 'null' will not display anything.
$varmixedfalse-Additional variables passed to the functions hooked to $id.


function beans_selfclose_markup( $id, $tag, $attributes = array() ) {

	global $_temp_beans_selfclose_markup;

	$_temp_beans_selfclose_markup = true;
	$args = func_get_args();

	return call_user_func_array( 'beans_open_markup', $args );