Skip to content

Commit 6c0d915

Browse files
Merge pull request #687 from wp-stream/issue-686
Hook load methods on init rather than plugins_loaded
2 parents 5d8dadb + 79e0288 commit 6c0d915

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

extensions/notifications/class-wp-stream-notifications.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function __construct() {
7575
return;
7676
}
7777

78-
add_action( 'plugins_loaded', array( $this, 'load' ) );
78+
add_action( 'init', array( $this, 'load' ) );
7979

8080
// Register post type
8181
require_once WP_STREAM_NOTIFICATIONS_INC_DIR . 'class-wp-stream-notifications-post-type.php';

extensions/reports/class-wp-stream-reports.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private function __construct() {
5454
return;
5555
}
5656

57-
add_action( 'plugins_loaded', array( $this, 'load' ) );
57+
add_action( 'init', array( $this, 'load' ) );
5858
}
5959

6060
/**

stream.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,11 @@ private function __construct() {
134134
add_action( 'wp_head', array( $this, 'frontend_indicator' ) );
135135

136136
if ( is_admin() ) {
137-
add_action( 'plugins_loaded', array( 'WP_Stream_Admin', 'load' ) );
138-
139-
add_action( 'plugins_loaded', array( 'WP_Stream_Dashboard_Widget', 'load' ) );
140-
141-
add_action( 'plugins_loaded', array( 'WP_Stream_Live_Update', 'load' ) );
142-
143-
add_action( 'plugins_loaded', array( 'WP_Stream_Pointers', 'load' ) );
144-
145-
add_action( 'plugins_loaded', array( 'WP_Stream_Migrate', 'load' ) );
137+
add_action( 'init', array( 'WP_Stream_Admin', 'load' ) );
138+
add_action( 'init', array( 'WP_Stream_Dashboard_Widget', 'load' ) );
139+
add_action( 'init', array( 'WP_Stream_Live_Update', 'load' ) );
140+
add_action( 'init', array( 'WP_Stream_Pointers', 'load' ) );
141+
add_action( 'init', array( 'WP_Stream_Migrate', 'load' ) );
146142
}
147143
}
148144

0 commit comments

Comments
 (0)