PluginProbe
Patchstack – WordPress & Plugins Security / 2.3.5
Patchstack – WordPress & Plugins Security v2.3.5
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
patchstack / includes / events / core.php

core.php in Patchstack – WordPress & Plugins Security 2.3.5, at includes/events/core.php

46 lines 957 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Do not allow the file to be called directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * This class is used to log any core updates.
10 */
11 class P_Event_Core extends P_Event_Log {
12
13 /**
14 * Hook into the action so we can log it.
15 *
16 * @return void
17 */
18 public function __construct() {
19 add_action( '_core_updated_successfully', [ &$this, 'eventCoreUpdatedSuccessfully' ] );
20 }
21
22 /**
23 * When the core version of WordPress has been updated.
24 *
25 * @param string $wp_version
26 * @return void
27 */
28 public function eventCoreUpdatedSuccessfully( $wp_version ) {
29 global $pagenow;
30 if ( $pagenow !== 'update-core.php' ) {
31 $object_name = 'WordPress core automatically updated';
32 } else {
33 $object_name = 'WordPress core updated';
34 }
35
36 $this->insert(
37 [
38 'action' => 'updated',
39 'object' => 'core',
40 'object_id' => 0,
41 'object_name' => $object_name,
42 ]
43 );
44 }
45 }
46