I'm trying to put my frontend form into a variable or a shortcode so I can wrap another shortcode around it (specifically Bainternet Post Creation Limits).
My form has PHP code in it so I'm not exactly sure how to do this. I have tried creating other variables for each line of PHP code but it's not working as I thought it might.
I know how to create a shortcode; I don't know how to put a form with PHP into a shortcode though. I don't know how to put the form into a variable at all and I can't find information how to do this.
Here's the form:
<form id="new_post" name="new_post" method="post" action="" class="submit-form" enctype="multipart/form-data">
<fieldset class="tax">
<label for="class">Class Price:</label>
<input type="text" value="" class="class" id="class" name="class" placeholder="20" /> €
<label for="accent">Accent:</label>
<?php wp_dropdown_categories( 'tab_index=15&taxonomy=accent&hide_empty=0&name=accent&show_option_all=Select one' ); ?>
<h2>Rates</h2>
<div class="teachratebox">
<label for="presencial">Face-to-face classes</label>
<?php
$clocations = get_terms('class-location', 'orderby=id&hide_empty=0');
$counter = 0;
foreach ($clocations as $clocation) {
$counter++;
$option = '<div class="slots"><input class="checkbox" type="checkbox" name="class-location[]" id="'.$clocation->slug.'" value="'.$clocation->slug.'" onclick="enable_text(this.checked)" />';
$option .= '<span class="clocation" for="clocations">'.$clocation->name.'</span>';
$option .= '<input type="text" class="rate" value="" id="'.$clocation->slug.'-rate" name="'.$clocation->slug.'-rate" disabled="disabled" /> €</div>';
echo $option;
}
?>
</div>
<input type="submit" value="Add Teacher" tabindex="40" id="psubmit" name="submit" />
</fieldset>
<input type="hidden" name="action" value="new_post" />
<?php wp_nonce_field( 'new-post' ); ?>
</form>
How do I put this form into a variable or a shortcode?