Tag Info

Hot answers tagged

2

I think the easiest way is adding the form via the Shortcode API. The code would look like this: function myform_handler( $atts ){ if (isset(@$_REQUEST['submit'])) { //Do something } else { $return = '<form action="" method="post"> <input type="text" name="myfield"> <input ...


2

You can do that using Javascript, by creating new DOM elements. You can use this Try it yourself functionality from W3Schools Copy and paste this code into Try it yourself and see how it works, it just adds a new paragraph: <!DOCTYPE html> <html> <body> <div id="div1"> <p id="p1">This is a paragraph.</p> <p ...


1

Use a PHP function to do this: https://php.net/strip_tags example: echo strip_tags("<div>my text</div>");


1

"create a plugin" isn't really a separate option, you'd still need to intercept requests somehow. I've used the init method, and it's a viable option. Checking isset on a POST var before kicking off your processing logic is extremely fast, I doubt you could even reliably measure the impact in the sea of other things going on in the load process. The other ...



Only top voted, non community-wiki answers of a minimum length are eligible