Plugin Directory

PHP Execution

The PHP Execution plugin allows embedding php code inside of posts and pages.

Download Version 1.0.0

Editing PHP code

  • php code can be edited in the html view of the editor.
  • php code is embedded into a post in the same way as you are used to: a php block begins with ''. The short open tag, i.e. '') somewhere inside a string in your php code block. If you do so, this ending delimeter will be matched and your code will inevitably break apart. So don’t write e.g.:
    some text
    <?php $test = "hello ?>"  ?>
    more text
  • Writing '$test = "hello ?&gt;"' instead will not lead to any problems.
  • Php code is not executed in the global scope. If you need to gain access to variables in the global scope you need to "import" them first with 'global $var1, $var2;'.
  • This plugin does not evaluate every single code snippet, but the content of the post as a whole. So the following lines won’t result in errors:
    <?php if ($test==true) { ?>
    The test was successful.
    <?php } else { ?>
    The test failed.
    <?php } ?>
  • When switching between html and visual view the php code is not altered in any case. All html tags, whitespaces etc. in your code are preserved.

Requires: 2.5 or higher
Compatible up to: 2.8.3
Last Updated: 2009-5-14 Downloads: 33,721

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(31 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
1 person says it's broken.

Log in to vote.

100,2,2
100,2,2
75,4,3
100,4,4
92,12,11
100,2,2
100,7,7
100,2,2
100,2,2
100,2,2
100,4,4
0,1,0
100,2,2
100,1,1
100,1,1
50,4,2
0,1,0