1. Home
  2. Index
  3. Shortcodes
  4. PHP Shortcodes

PHP Shortcodes

This code type allows plugin users to add PHP code to a web page. The code is added to a web page with a shortcode.

Example code

Image

Add to web page

[cmruncode id="25"]

or

[cmruncode name="Hello World"]

Result

Hello World

Custom parameters

The Code Manager supports custom parameters like:

[cmruncode name="Hello World" param1="ABC123" param2="DEF456"]

Use global $wpda_shortcode_args to get access to arguments like:


global $wpda_shortcode_args;
if ( isset( $wpda_shortcode_args['param1'] )  && isset( $wpda_shortcode_args['param2'] ) ) {
	// Your code goes here...
}

 

How can we help?