Permalink
Browse files

Moves setup code from VIP_Scanner_UI::__construct() into the init action

To allow hooking into the actions / filters called here, which is
impossible unless the hooking code was included before VIP Scanner
(which is up to WP’s plugin loading order).

Fixes #70
  • Loading branch information...
1 parent 69a1f32 commit 85a438b0bcb1b1e0532059dd374d679881cee254 @nickdaugherty nickdaugherty committed Feb 11, 2014
Showing with 5 additions and 5 deletions.
  1. +5 −5 vip-scanner.php
View
@@ -25,25 +25,25 @@ class VIP_Scanner_UI {
function __construct() {
add_action( 'init', array( $this, 'init' ) );
add_action( 'admin_init', array( $this, 'admin_init' ) );
- do_action( 'vip_scanner_loaded' );
+ }
+ function init() {
+ add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
$this->blocker_types = apply_filters( 'vip_scanner_blocker_types', array(
'blocker' => __( 'Blockers', 'theme-check' ),
'warning' => __( 'Warnings', 'theme-check' ),
'required' => __( 'Required', 'theme-check' ),
) );
+ do_action( 'vip_scanner_loaded' );
+
$review_types = VIP_Scanner::get_instance()->get_review_types();
$this->default_review = apply_filters( 'vip_scanner_default_review', 0, $review_types );
$this->to = apply_filters( 'vip_scanner_email_to', '' );
}
- function init() {
- add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
- }
-
function admin_init() {
if ( isset( $_POST['page'], $_POST['action'] ) && $_POST['page'] == self::key && $_POST['action'] == 'Export' )
$this->export();

0 comments on commit 85a438b

Please sign in to comment.