Trying to implement my own "shortcode"-type system on my cms.
substr()
can possibly work as long as there isn't more than one shortcode in the content. I can't use <?php
?>
, but must use a WYSIWYG
type editor for entering in the shortcode, since it is the enduser who will be entering them via the content editor.
If someone enters a "Shortcode" that follows the rules I set, this class function will discover the shortcode, parse it and then replace the shortcode with other data pulled from mysql or another source.
I can get this to work, essentially no problem, if there is not more than one single shortcode entered into the content via WYSIWYG
, but more than one and it breaks.
I've looked all over the internet for this and found various things, but most of them deal with Wordpress
and the few that don't aren't approaching it as I need to. Found one threat on StackOverflow
which provides a potential approach that I could use, but I really need advice and a place to start more than a full function. The Wordpress
Shortcode system isn't helpful either.