[theme-reviewers] WP default widgets generate php notices
Otto
otto at ottodestruct.com
Thu Dec 2 20:36:11 UTC 2010
WP itself is not free of debug notice errors. I tend to ignore them.
-Otto
On Thu, Dec 2, 2010 at 2:08 PM, Ivan Milaev <vatuma at gmail.com> wrote:
> 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
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
More information about the theme-reviewers
mailing list