I am creating plugin that display a quotation From.
public function qt_shortcodez() {
$QT_Options = get_option("qt_settings");
$Form = '<table>
<tbody>
<tr>
<td><label>Company Name <span class="text-error">*</span></label></td>
<td><input type="text" name="username" id="username" /></td>
</tr>
<tr>
<td><label>Phone <span class="text-error">*</span></label></td>
<td><input type="text" name="username" id="phone" /></td>
</tr>
<tr>
<td><label>Email</label></td>
<td><input type="text" name="username" id="email" /></td>
</tr>
</tbody>
</table>';
return $Form;
}
But it is more bigger form then this($Form
), Is there a way to use the template into the shortcodes? Like
public function qt_shortcodez() {
$QT_Options = get_option("qt_settings");
// I tried but it is not working :(
include( sprintf('%s/template/shortcode.php', dirname(__FILE__)) );
}
shortcode.php
look like? Including files within a shortcode function is absolutely possible. And BTW, why do you usesprintf
for theinclude
?