I have created a form using visual composer. In this form I want to assign a PHP function defined in functions.php to the submit button.
How can I do this?
You Can Do Like This
// Your Shortcode to output the custom PHP in Visual Composer.
function my_vc_shortcode( $atts ) {
// Your Custom Php Code Here
return '<h2>This is my custom PHP output!</h2>';
}
add_shortcode( 'my_vc_php_output', 'my_vc_shortcode');
Check Source Code Here: