The PWS PHParse WordPress plugin allows one to use shortcodes to execute php files where wanted.
If the executed php script has output, the output is written where the shortcode was entered.
If no output is found, the php script is simply run and the shortcode is removed in the output. This can be handy when using custom tracking solutions and other such code.
- Status: Beta
- Availability: Privateer Theme Owners
See your members product page to download.
Currently, the PHParse plugin is very solid, but I am going to make a few handy default scripts before I move it out of beta.
This plugin should work fine with any decent theme and includes a widget so that php code can be executed within the sidebars.
For the Privateer, this plugin has built in shortcode support and can be placed outside of sidebars, posts, and pages without having to do any template editing.
Once installed, the PHParse plugin adds a new admin menu: Tools – WP PHParse.
Within the admin menu, you can choose whether or not to have the plugin activate the content filter ( Set this to Yes for non-privateer themes and No for all other themes ) and whether or not to use the filter on multi-pages ( set to No if you don’t want post level phparse entries processed on multi pages such as the search or archive pages ).
Usage
To use the PHParse plugin, you need two things:
- A php script to run
- A shortcode somewhere to run the script
PHP scripts need to be stored in the phparse plugins files sub-directory.
They can then be referenced via the following shortcode syntax (without the spaces):
- [[[ pwsphparse|file=FILENAME ]]]
Of course FILENAME should be the full name of the script to run…and the script should handle all wanted parsing. So, php scripts should take care of including any needed external files, declaring any classes or functions, and making use of them to perform the wanted action.
Included Scripts
Currently, no php scripts are included with this plugin. Before I move it from being a beta plugin to a release plugin, I will include a couple of scripts that people should find useful for different types of web sites.








