Shortcode Plugin
docs/plugins/plugin.jacshortcode
/* Title: Shortcode Plugin pluginname: jacshortcode description: Adds a wordpress style shortcode ability to Phile Markup. version: 0.5 revisiondate: 23 OCT 2013 pluginauthor: jacmgr Chapter: plugins.2 */ ## Shortcode Plugin Use wordpress style shortcodes in your page markup. This plugin allows you to make other plugins to implement more shortcodes. This plugin simply loads the shortcode engine, and then processes shortcodes defined in other plugins. [[#ENDSUMMARY]] Why? Well, I don't understand regular expressions and not an advanced coder, so using shortcodes gave me an easy way to add functionality. In fact individual plugins not using shortcodes could be easily made by someone more advanced than me. Currently the addon processes all shortcodes in the `before_parse_content` event. One simple shortcode is included in this plugin. It basically displays the current year and takes no parameters. You use it in your page content like this: Page CONTENT: ~~~~ YO! The current year is [\show_current_year], is it right? ~~~~ Results in: > YO! The current year is [show_current_year], is it right? OTHER SHORTCODE PLUGINS: * [Include another file in the current page](plugin.jacshortcode.include) * [Search pages for a list of pages meeting your criteria and display info for all of them](plugin.jacshortcode.search) * [Amazon ASIN Image Link](plugin.jacshortcode.amazon) * [Show an image gallery](plugin.jacshortcode.gallery) ## Notes I found the [shortcodes.php processor file here](http://forums.phpfreaks.com/topic/236984-wordpress-style-shortcode-function/). It worked without any modification. The shortcode plugin will include that file which then will control the registration of all other shortcodes you create. I have used individual plugins for each shortcode, but you can put several related shortcodes in a single plugin. This is the source of the main shortcode processor. The source is displayed here using the `include file shortcode`: ~~~~ [\include file=%\SYSTEMFOLDER%plugins/jacshortcodes/Classes/Plugin.php] ~~~~ ~~~~ [include file="%SYSTEMFOLDER%plugins/jacshortcodes/jacShortCodes/Classes/Plugin.php"] ~~~~