i4w_exec

Usage:

This shortcode allows the injection of PHP code into a post, page, excerpt or widget.

CAUTION:This shortcode uses the PHP eval() language construct / function. The eval() language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged. If you have carefully verified that there is no other option than to use this construct, pay special attention not to pass any user provided data into it without properly validating it beforehand.

This shortcode does NOT supports conditional branching with [ELSE_exec].

Shortcode nesting is NOT supported.

Parameters:

This shortcode doesn’t require parameters but expects PHP code (without <?php and ?>) to be placed between the start and end tags.
Default: none.
Required: no.

Example:

[i4w_exec]
  $a = 3;
  $b = 5;
  $c = $a + $b;
  echo $c;
[/i4w_exec]

[i4w_exec]
  @include($my_path . ‘my_php_script’);
[/i4w_exec]

Notes:

This shortcode runs PHP code using PHP’s “eval()” function. As such, variable scope is affected.

API:

There is no API function equivalent for this shortcode.