Opened 10 years ago
Closed 10 years ago
#5736 closed enhancement (fixed)
messages_format_notifications(): variables not in scope
Reported by: | wpdennis | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Messages | Keywords: | needs-patch good-first-bug |
Cc: |
Description
If messages_format_notifications() is used with any other action than "new_message", the variables $link, $filter and $text aren't declared before usage:
if ( 'string' === $format ) { $return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $link, $item_id, $secondary_item_id ); } else { $return = apply_filters( $filter, array( 'text' => $text, 'link' => $link ), $link, (int) $total_items, $text, $link, $item_id, $secondary_item_id ); }
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Should be an easy fix for someone looking to contribute a patch: just need to make sure these variables are declared sensibly at the top of the file.