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 to open markup.
  • 'echo'
    (bool) Flag indicating whether to echo or return the resultant string.

Default value: array()


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;
}

Changelog

Changelog
Version Description
3.3.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.