@@ -18,23 +18,37 @@ class CoreUpdate extends Section {
18
18
/**
19
19
* The comment moderation entries.
20
20
*
21
+ * @since 2.0.0
22
+ * @access protected
23
+ *
21
24
* @var array
22
25
*/
23
26
protected $ entries ;
24
27
28
+ /**
29
+ * The event type.
30
+ *
31
+ * @since 2.0.0
32
+ * @access protected
33
+ *
34
+ * @var string
35
+ */
36
+ protected $ event ;
37
+
25
38
/**
26
39
* Constructor.
27
40
*
41
+ * @since 2.0.0
42
+ * @access protected
43
+ *
28
44
* @param array $entries The core update entries.
29
45
* @param WP_User $user The current user.
30
46
* @param string $event The current event.
31
47
*/
32
48
public function __construct ( $ entries , WP_User $ user = null , $ event ) {
33
- parent ::__construct ( $ user );
49
+ parent ::__construct ( $ entries , $ user );
34
50
35
- foreach ( $ entries as $ version => $ time ) {
36
- $ this ->entries [] = $ this ->get_single_message ( $ version , $ time , $ event );
37
- }
51
+ $ this ->event = $ event ;
38
52
}
39
53
40
54
/**
@@ -51,12 +65,11 @@ public function get_message() {
51
65
*
52
66
* @param string $version The version WordPress was updated to.
53
67
* @param int $time The timestamp when the update happened.
54
- * @param string $event The current event.
55
68
*
56
69
* @return string The core update message.
57
70
*/
58
- protected function get_single_message ( $ version , $ time, $ event ) {
59
- if ( 'core_update_success ' === $ event ) {
71
+ protected function get_single_message ( $ version , $ time ) {
72
+ if ( 'core_update_success ' === $ this -> event ) {
60
73
return $ this ->get_core_update_success_message ( $ version , $ time );
61
74
} else {
62
75
return $ this ->get_core_update_fail_message ( $ version , $ time );
0 commit comments