Opened 4 years ago
Closed 4 years ago
#10225 closed defect (bug) (fixed)
Various php notices in default-widgets.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Warnings/Notices | Version: | 2.9 |
| Severity: | minor | Keywords: | |
| Cc: | Mittineague |
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)
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'];
comment:5
Mittineague — 4 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?
comment:6
Mittineague — 4 years ago
- Cc Mittineague added
r11757 fixed this, no?
Note: See
TracTickets for help on using
tickets.

That logic is wrong, Well, I mean the bracketing is.
Should be: