Wrap markup.
This function calls beans_open_markup() before the opening markup and beans_close_markup() after the closing markup.
beans_wrap_markup( string $id, string $new_id, string $tag, string|array $attributes = array() )
Return: (bool) Will always return true.
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
$id | string | true | - | The markup ID. |
$new_id | string | true | - | A unique string used as a reference. The $id argument may contain sub-hook(s). |
$tag | string | true | - | The HTML wrap tag. |
$attributes | string|array | false | array() | Query string or array of attributes. The array key defines the attribute name and the array value define 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. |
$var | mixed | true | - | Additional variables passed to the functions hooked to $id. |
Source
function beans_wrap_markup( $id, $new_id, $tag, $attributes = array() ) {
$args = func_get_args();
unset( $args[0] );
_beans_add_anonymous_action( $id . '_before_markup', array( 'beans_open_markup', $args ), 9999 );
unset( $args[3] );
_beans_add_anonymous_action( $id . '_after_markup', array( 'beans_close_markup', $args ), 1 );
return true;
}