astra_markup_open( string $context, array $args = array() )
Generate HTML Open markup
Description
Parameters
- $context
-
(string) (Required) unique markup key.
- $args
-
(array) (Optional) Contains markup arguments.
- 'attrs'
(array) Initial attributes to apply toopenmarkup. - 'echo'
(bool) Flag indicating whether to echo or return the resultant string.
Default value: array()
- 'attrs'
Return
(mixed)
Source
File: inc/extras.php
function astra_markup_open( $context, $args = array() ) {
$defaults = array(
'open' => '',
'attrs' => array(),
'echo' => true,
'content' => '',
);
$args = wp_parse_args( $args, $defaults );
if ( $context ) {
$args = apply_filters( "astra_markup_{$context}_open", $args );
$open_tag = $args['open'] ? sprintf( $args['open'], astra_attr( $context, $args['attrs'] ) ) : '';
if ( $args['echo'] ) {
echo $open_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $open_tag;
}
}
return false;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |