hypejunction/hypeshortcode

Shortcode support

1.2.0 2018-06-29 20:01 UTC

README

Add support for custom BB-style shortcodes

Usage

Register shortcode

elgg()->shortcodes->register('mycode');

// then add a view in shortcodes/mycode
// view vars will contain attributes of the shortcode

Generate a shortcode tag

elgg()->shortcodes->generate('mycode', [
	'foo' => 'bar',
]);

Expand shortcodes

elgg()->shortcodes->expand($text);

Strip shortcodes

elgg()->shortcodes->strip($text);