Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #25880


Ignore:
Timestamp:
11/09/2013 03:53:24 AM (12 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25880 – Description

    initial v2  
    1 Unlike, ''wp_notify_moderator()'' that uses a ''switch/case()'' statement that defaults to comment types of type 'comment', ''wp_notify_moderator()'' uses an ''if/else()'', resulting in '$notify_message' and '$subject' undefined var notices when these vars are concatenated later in that same function, when using a custom comment type:
    2 
    3 ''Notice: Undefined variable: notify_message in ...wp-includes\pluggable.php on line 1076
    4 Notice: Undefined variable: subject in ...\wp-includes\pluggable.php on line 1109''
    5 
    6 This can be easily fixed by initializing the vars ($var = '') or by replacing the ''if/else()'' with a ''switch/case()'' that defaults to 'comment'.
     1Unlike `wp_notify_moderator()`, that uses a `switch/case()` statement that defaults to comment types of type 'comment', `wp_notify_postauthor()` uses an `if/else()`, resulting in `$notify_message` and `$subject` undefined var notices when these vars are concatenated later in that same function, when using a custom comment type:
     2{{{
     3Notice: Undefined variable: notify_message in ...wp-includes\pluggable.php on line 1076
     4Notice: Undefined variable: subject in ...\wp-includes\pluggable.php on line 1109
     5}}}
     6This can be easily fixed by initializing the vars (`$var = ''`) or by replacing the `if/else()` with a `switch/case()` that defaults to 'comment'.