Created: 15/02/2011, revision 1
By: Web factory Ltd
Email: info@webfactoryltd.com
Thank you very much for purchasing our WordPress plugin. If you have any questions that are beyond the scope of this help file, please feel free to email us via our user page contact form. Have a good one!
[php]echo 'This is a random number: ' . rand(0, 100) . '.';[/php]
[php]global $post; echo 'ID of this post is ' . $post->ID . '.';[/php]
[php errors="show"]echo $test;[/php]
[php action="show"]global $wpdb; $time = $wpdb->get_var('SELECT NOW()'); echo 'The time is: ' . $time; [/php]
All options are configured in WP Admin – Settings – 5sec Run PHP or as shortcode parameters.
Option name | Description | Default |
Error Reporting | When developing it's useful to show all errors but in production environments please hide all errors. This option can be overwritten on a per-shortcode basis with "errors" parameter. | hide all errors, warnings and notices |
Action for PHP Code in Content | 5sec Run PHP plugin is ment to run PHP code but you can use this aditional functionality to provide security or to show off your code. This option can be overwritten on a per-shortcode basis with "action" parameter. | run PHP code |
Action for PHP Code in Excerpt | See above. | run PHP code |
Action for PHP Code in Text Widget | See above. | run PHP code |
Action for PHP Code in RSS Content | See above. | run PHP code |
Action for PHP Code in RSS Excerpt | See above. | run PHP code |
Shortcode name | Change the shortcode name is another plugin is already using it. Write only the shortcode name, without brackets. | php |
You don't have to write opening and closing PHP tags (<?php ?>) in your code. Just use: [php] //code [/php] If you want to access post data for current post remember to put "global $post" in your code. Same applies to "global $wpdb".
Error reporting is globally defined in options but it's also available on a per-shortcode basis using the "error" parameter. Ie: [php errors="hide"] // some code [/php]. Accepted values: default, show, hide.
Actions are globall defined in options but can also be defined on a per-shortcode basis using the "action" parameter. Ie: [php action="show"] // some code [/php]. Accepted values: run, delete, show, show-plain.
When action is set to "show-plain" the code is outputed in a <span> element with "php-code" class.
When action is set to "show" the code is outputed in a <pre> element with "php-code" class and aditional CSS is included in your site's footer for code styling (please be sure your theme uses wp_footer() function call).
It's really hard to say what's causing them but check and double-check your syntax. Do you have all brackets closed? All semi columns in place? Are all the variables you're using in the right scope?
That completely depends on the code you write. Plugin itself has an absolute minimal footprint when not used. Please don't write miles of code in posts. Write a plugin or use functions.php. It' much better / faster / safer.
If you're able to write the code - sure. Just remember to make the $wpdb object global using "global $wpdb".
No. You can just output formatted code for easier reading.
No external PHP related assets or other copyrighted materials were used in this script's code.
Once again, thank you so much for purchasing this WordPress plugin. As stated at the beginning, we'd be glad to help you if you have any questions relating to this theme. We'll do our best to assist. If you have a more general question relating to the themes on ThemeForest, you might consider visiting the forums and asking your question in the "Item Discussion" section.
Web factory Ltd.