- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- some text <a href="www.test.com">Click here</a> some text
<?php
$text = 'some text [BUTTON link="www.test.com" label="Click here"] some text';
echo preg_replace(
'/\[button link="([^"]+)" label="([^"]+)"]/i',
'<a href="$1">$2</a>',
$text
);