我为WordPress发布了一个插件,并且客户端启用了严格标准。我已经解决了大多数通知和警告,但是这个让我很难过。如何在错误报告中修复此通知?我为WordPress做错了什么?
错误:[13-Mar-2015 17:04:41 UTC] PHP Strict Standards: Redefining already defined constructor for class GARD_PRO_CSE in D:\home\site\wwwroot\wp-content\plugins\gard-pro\insert.php on line 281
代码:
if ( strpos(@$GLOBALS['gard_pro']['CSE' ], 'cse') && !class_exists('GARD_PRO_CSE')) {
class GARD_PRO_CSE extends WP_Widget {
function GARD_PRO_CSE() {
parent::WP_Widget(false, $name = "GARD Pro Custom Search Engine");
}
public function __construct() {
parent::__construct(
'GARD_PRO_CSE', // Base ID
'GARD Pro Custom Search Engine', // Name
array( 'description' => __( "Shows custom Google Search Engine", 'text_domain' ), ) // Args
);
}
// REMOVED WP CODE TO CREATE WIDGET
}
add_action('widgets_init', create_function('','return register_widget("GARD_PRO_CSE");'));
}