Opened 17 years ago
Closed 17 years ago
#10225 closed defect (bug) (fixed)
Various php notices in default-widgets.php
| Reported by: | mrmist | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Warnings/Notices | Version: | 2.9 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
Description
The attached fixes various undefined index notices which appear when wp_debug is enabled and the widgets page is visited with various widgets and widget titles.
Attachments (1)
Change History (10)
#4
@
17 years ago
nit picking, but things like this:
$count = isset($instance['count']) ? (bool) $instance['count'] :false;
could also be written like:
$count = isset($instance['count']) && $instance['count'];
#5
@
17 years ago
I got an E_NOTICE with (with my version of a fix)
class WP_Widget_Search extends WP_Widget {
.....
function widget( $args, $instance ) {
.....
// $title = apply_filters('widget_title', $instance['title']);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Search') : $instance['title']);
And I haven't figured out how to fix this one yet
class WP_Widget_Text extends WP_Widget {
.....
function widget( $args, $instance ) {
which has an index not defined for $instancefilter
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
That logic is wrong, Well, I mean the bracketing is.
Should be: