我尝试创建一个新类,该类包含一个创建短代码的操作,该短代码位于我的站点上,但似乎不起作用。谁能告诉我哪里出了问题?
该类是在其自己的PHP文件中编写的,该文件位于site\\URL/includes/frontend。登记表。php
Dreamweaver没有抛出任何语法错误?
<?php
class RegistrationForm {
function __construct (){
$this->make_shortcode();
}
function make_shortcode (){
add_shortcode (\'Show Form\', array($this, \'form_generate\'));
}
function form_generate () {
ob_start(); ?>
<form class="form-horizontal">
<fieldset>
<!-- Form Name -->
<legend>Form Name</legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Name</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="Name" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Email Address</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="Email" class="form-control input-md" required="">
</div>
</div>
<!-- Password input-->
<div class="form-group">
<label class="col-md-4 control-label" for="passwordinput">Password</label>
<div class="col-md-4">
<input id="passwordinput" name="passwordinput" type="password" placeholder="Password" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Store Name</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="Store Name" class="form-control input-md" required="">
</div>
</div>
</fieldset>
</form>
<?php $output = ob_clean();
return ($output);
}
} /*END OF CLASS*/
$new_form = new RegistrationForm;
return ($new_form);
?>