我正在構建我的第一個WordPress的自定義小部件,我對此持懷疑態度。到目前爲止,這是WordPress的小部件開發
<?php
//Add an action that will load all widgets
add_action('widgets_init', 'ma_load_widgets');
//Function that registers the widgets
function ma_load_widgets() {
register_widget('ma_my_widget');
}
/*-----------------------------------------------------------------------------------
Plugin Info : Goes here
-----------------------------------------------------------------------------------*/
class ma_my_widget extends WP_Widget {
function ma_my_widget(){
code_goes_here
}
function widget($args, $instance){
extract($args);
code_goes_here
}
function update($new_instance, $old_instance){
$instance = $old_instance;
code_goes_here
return $instance;
}
function form($instance){
code_goes_here
}
}
?>
我已保存這段代碼爲widget.php文件放入文件夾包括,我的工作在WP 3.5二12,但是當我在去小部件我部件的結構我後端我看不到它。我究竟做錯了什麼?