I was having trouble inserting a form to a post by admin on the main blog, wpmu would strip out the form tags and other input tags. I did a search for how to show html in the posts but the answers all required an edit of some vital file.
I figured shortcodes was the answer but even the html returned by the handler got stripped out.
another search turned up the wp_filter_post_kses filter so I managed to use
remove_filter('the_content','wp_filter_post_kses');
within the shortcode handler and the html stayed.
here’s what I put in functions.php of the main wpmu theme
function listluv_showform($params,$content= null){
// need to remove html stripping filter from the content before display
remove_filter('the_content','wp_filter_post_kses');
// get the params as $key = $value
extract( shortcode_atts(array('form_name' => 'comluv_updates'),$params) );
// start the check for type of form
if($form_name == 'comluv_updates'){
$result = '<form action="http://comluv.com/listluv/subscribe.php" method="post">Name/Username<br /><input type="text" name="FormValue_Fields[CustomField1]" value="" id="FormValue_CustomField1" /><br /><br />Email Address<br /><input type="text" name="FormValue_Fields[EmailAddress]" value="" id="FormValue_EmailAddress"><br /><br /><input type="submit" name="FormButton_Subscribe" value="Subscribe" id="FormButton_Subscribe"><input type="hidden" name="FormValue_ListID" value="1" id="FormValue_ListID"><input type="hidden" name="FormValue_Command" value="Subscriber.Add" id="FormValue_Command"></form>';
}
return $result;
}
add_shortcode('listluv-subscribe-form','listluv_showform');
I call it within the post using
[listluv_showform form_name="listluv_updates"/]
might be helpful to someone..