Skip to content
This repository
Browse code

Break Automattic_Developer_Empty_Upgrader_Skin out into an includes file

  • Loading branch information...
commit eeb1683ec36f0e93ceb70f48bbb6116e32595a3c 1 parent 2d83d77
Alex Mills authored April 19, 2012
36  developer.php
@@ -15,6 +15,11 @@
15 15
 
16 16
 **************************************************************************/
17 17
 
  18
+// Load helper class if installing a plugin
  19
+if ( ! empty( $_POST['action'] ) && 'a8c_developer_install_plugin' == $_POST['action'] )
  20
+	require_once( __DIR__ . '/includes/class-empty-upgrader-skin.php' );
  21
+
  22
+
18 23
 class Automattic_Developer {
19 24
 
20 25
 	public $settings               = array();
@@ -564,35 +569,4 @@ public function is_recommended_plugin_installed( $slug ) {
564 569
 
565 570
 $Automattic_Developer = new Automattic_Developer();
566 571
 
567  
-
568  
-
569  
-if ( ! empty( $_POST['action'] ) && 'a8c_developer_install_plugin' == $_POST['action'] ) {
570  
-
571  
-	include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
572  
-
573  
-	class Automattic_Developer_Empty_Upgrader_Skin extends WP_Upgrader_Skin {
574  
-		function __construct($args = array()) {
575  
-			$defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
576  
-			$args = wp_parse_args( $args, $defaults );
577  
-
578  
-			$this->type = $args['type'];
579  
-			$this->api = isset( $args['api'] ) ? $args['api'] : array();
580  
-
581  
-			parent::__construct( $args );
582  
-		}
583  
-
584  
-		public function request_filesystem_credentials() {
585  
-			return true;
586  
-		}
587  
-
588  
-		public function error() {
589  
-			die( '-1' );
590  
-		}
591  
-
592  
-		public function header() {}
593  
-		public function footer() {}
594  
-		public function feedback() {}
595  
-	}
596  
-}
597  
-
598 572
 ?>
27  includes/class-empty-upgrader-skin.php
... ...
@@ -0,0 +1,27 @@
  1
+<?php
  2
+
  3
+include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
  4
+
  5
+class Automattic_Developer_Empty_Upgrader_Skin extends WP_Upgrader_Skin {
  6
+	function __construct($args = array()) {
  7
+		$defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
  8
+		$args = wp_parse_args( $args, $defaults );
  9
+
  10
+		$this->type = $args['type'];
  11
+		$this->api = isset( $args['api'] ) ? $args['api'] : array();
  12
+
  13
+		parent::__construct( $args );
  14
+	}
  15
+
  16
+	public function request_filesystem_credentials() {
  17
+		return true;
  18
+	}
  19
+
  20
+	public function error() {
  21
+		die( '-1' );
  22
+	}
  23
+
  24
+	public function header() {}
  25
+	public function footer() {}
  26
+	public function feedback() {}
  27
+}

0 notes on commit eeb1683

Please sign in to comment.
Something went wrong with that request. Please try again.