[theme-reviewers] WP default widgets generate php notices
Ivan Milaev
vatuma at gmail.com
Thu Dec 2 20:08:01 UTC 2010
Hi all,
I've created the Clear Line theme (
http://themes.trac.wordpress.org/ticket/2203).
The theme uses default widgets in the way like this:
> the_widget('WP_Widget_Categories', '',
> 'before_title=<h5>&after_title=</h5>');
>
Such function call generates php notices:
> Notice: Undefined index: count in
> Z:\home\wp\www\wp-includes\default-widgets.php on line 430
> Notice: Undefined index: hierarchical in
> Z:\home\wp\www\wp-includes\default-widgets.php on line 431
> Notice: Undefined index: dropdown in
> Z:\home\wp\www\wp-includes\default-widgets.php on line 432
So the notices are generated in WP core file in such lines:
> $c = $instance['count'] ? '1' : '0';
> $h = $instance['hierarchical'] ? '1' : '0';
> $d = $instance['dropdown'] ? '1' : '0';
>
I.e. if I don't set parameters (that are not required) these indexes do not
exist and the notices appear.
I can avoid appearing these notices by setting the parameters but if I call:
> the_widget('WP_Widget_Recent_Posts', '',
> 'before_title=<h5>&after_title=</h5>');
>
the notices are:
> Notice: Undefined index: widget_id in
> Z:\home\wp\www\wp-includes\default-widgets.php on line 529
> Notice: Undefined index: number in
> Z:\home\wp\www\wp-includes\default-widgets.php on line 538
>
One of these notices is generated by this line:
> if ( isset($cache[$args['widget_id']]) ) {
>
That means that I cannot avoid this notice...
The question are:
Should the theme be approved with such notices?
Should WP team fix these notices?
Or should I?
Regards,
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20101202/3225ed80/attachment-0001.htm>
More information about the theme-reviewers
mailing list