OK well this plugin is quite powerful, so this may not suit all scenarios. However, I would add something like this to get people started…
:::: Shortcode – Put this in your page/post ::::
Shortcode Example 1. Defaults
[myphpscriptnamehere]
– Calls ‘myphpscriptnamehere’ as configured in Exec PHP. Any variables in the script will parse as defaults (set in the PHP script below).
Shortcode Example 2. Two Attributes Parsed as Variables
[myphpscriptnamehere name="John" location="Earth"]
– Shortcode includes two example attributes which we will parse as variables.
:::: Settings and PHP Code ::::
WordPress Admin -> Tools -> Exec PHP -> Scroll down to Shortcodes. Add your PHP, name the script ‘myphpscriptnamehere’ from above and click Add. Remember to add your PHP code, without the <?php and ?> tags.
Example PHP Script (Works with both above)
extract(shortcode_atts(array('name' => 'No Name', //Notes: Listens for 'name' attribute, and adds 'No Name' as default.
'location' => 'Somewhere', //Notes: Listens for 'location' attribute, and adds 'Somewhere' as default.
), $atts));
echo ('Hello ').$name.(' from ').$location; //Notes: When run on a page load our little app spits out the defaults, or attributes, based on the shortcode you used.
Output when page/post is loaded…
Example 1.
Hello No Name from Somewhere
Example 2.
Hello John from Earth