Easily set your Basic Text Element to default as
or any other tag. As a bonus, I've added <ul>
and <li>
tags, so no more chumpin' setting custom code.
Copy and paste the following code into your bricks-child/functions.php:
add_filter('bricks/elements/text-basic/controls', function ($controls) {
$controls['tag'] = [
'tab' => 'content',
'label' => esc_html__('HTML tag', 'bricks'),
'type' => 'select',
'options' => [
'div' => 'div',
'p' => 'p',
'span' => 'span',
'figcaption' => 'figcaption',
'address' => 'address',
'figure' => 'figure',
'ul' => 'ul',
'li' => 'li',
'custom' => esc_html__('Custom', 'bricks'),
],
'lowercase' => true,
'inline' => true,
//'placeholder' => 'p',
'default' => 'p',
];
$controls['customTag'] = [
'tab' => 'content',
'label' => esc_html__('Custom tag', 'bricks'),
'type' => 'text',
'inline' => true,
'placeholder' => 'div',
'required' => ['tag', '=', 'custom'],
];
return $controls;
});