Add-on Features:

  • Use shorcodes from other plugins in your forms
  • Create your own shorcodes to output you very own PHP in forms.
    
This is some custom content generated form a shortcode

How this was done.

1. Add the below code to you theme's functions.php file

add_shortcode( 'MY_CUSTOM_SHORTCODE', 'my_custom_php_function' );

function my_custom_php_function($atts){

  $defaults = array(
    'some_content' => ''
  );
  extract( shortcode_atts( $defaults, $atts ) );
  wp_parse_args($atts, $defaults);

  return $some_content;
}



2. Add and HTML element anywhere in your form and change the content to this shortcode:

[MY_CUSTOM_SHORTCODE some_content="this is some custom content generated form a shortcode"]

This is a very simply example but you can output anything like a custom select that is populated by your own database table.