I’m not sure what you are doing with the first one, but the second has a couple of problems.
First, you neglected to include a section for arguments when you defined your function:
function input_replace{
This will create a syntax error as your function must have () after the function name. And in this case, you need to pass the generated form to the function as an argument:
function input_replace( $form ) {
Second, the string that you are searching for (defined as $old in your code) MUST be an EXACT match of what is generated in the form. I would suggest the following:
- I assume that you have created this field as a placeholder in the plugin’s field manager. If not, you need to do that.
- Bring up the form in your browser and view source in your browser.
- Find the field in the html source and copy/paste that into your code as the string you are searching for.
My guess is the string you should be searching for in this should look something like this (assuming you called it “test” and it is a text field):
<input name="test" type="text" id="test" value="" class="textbox" />