Shortcode Callback

Shortcode Callback Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 1,557 downloads
Shortcode Callback Icon

Try plugin: Shortcode Callback

We'll create fresh WordPress site with Shortcode Callback installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Shortcode Callback

Adds a [callback] shortcode that can trigger PHP code so you can insert custom/complex things into your pages/posts.

1


0


0


0


0

updated: 9 years ago
since: 9 years ago
author: Digital Point

Description

The Shortcode Callback plugin allows you to use a [callback] shortcode to execute arbitrary PHP code wherever the shortcode is used.

Usage

Execute someFunction() and insert whatever it returns with the following shortcode:
[callback function=”someFunction”]

Example shortcode to include a PHP file (the path is relative to WordPress’ ABSPATH), then insert the results of someFunction() where you used the shortcode:
[callback include=”custom/filetoinclude.php” function=”someFunction”]

Shortcode example that includes a PHP file (the path is relative to WordPress’ ABSPATH), then passes a paramter to someFunction() and returns the results where you used the shortcode:
[callback function=”someFunction” include=”custom/filetoinclude.php” param=”something”]

The format to call a class/method with the shortcode is exactly the same as above, except you specify the class::method in the “function” attribute of the shortcode.
[callback function=”someClass::someFunction” include=”custom/filetoinclude.php” param=”something”]

There is an example (with PHP code) over here.