- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-plugin-installer-skin.php
r41584 r42343 21 21 22 22 /** 23 *24 23 * @param array $args 25 24 */ 26 public function __construct($args = array()) { 27 $defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' ); 28 $args = wp_parse_args($args, $defaults); 25 public function __construct( $args = array() ) { 26 $defaults = array( 27 'type' => 'web', 28 'url' => '', 29 'plugin' => '', 30 'nonce' => '', 31 'title' => '', 32 ); 33 $args = wp_parse_args( $args, $defaults ); 29 34 30 35 $this->type = $args['type']; 31 $this->api = isset($args['api']) ? $args['api'] : array();36 $this->api = isset( $args['api'] ) ? $args['api'] : array(); 32 37 33 parent::__construct( $args);38 parent::__construct( $args ); 34 39 } 35 40 … … 37 42 */ 38 43 public function before() { 39 if ( !empty($this->api) ) 40 $this->upgrader->strings['process_success'] = sprintf( __('Successfully installed the plugin <strong>%s %s</strong>.'), $this->api->name, $this->api->version); 44 if ( ! empty( $this->api ) ) { 45 $this->upgrader->strings['process_success'] = sprintf( __( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' ), $this->api->name, $this->api->version ); 46 } 41 47 } 42 48 … … 48 54 $install_actions = array(); 49 55 50 $from = isset( $_GET['from']) ? wp_unslash( $_GET['from'] ) : 'plugins';56 $from = isset( $_GET['from'] ) ? wp_unslash( $_GET['from'] ) : 'plugins'; 51 57 52 58 if ( 'import' == $from ) { 53 59 $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&from=import&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin & Run Importer' ) . '</a>'; 54 } else if ( 'press-this' == $from ) {60 } elseif ( 'press-this' == $from ) { 55 61 $install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&from=press-this&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin & Return to Press This' ) . '</a>'; 56 62 } else { … … 73 79 } 74 80 75 if ( ! $this->result || is_wp_error( $this->result) ) {81 if ( ! $this->result || is_wp_error( $this->result ) ) { 76 82 unset( $install_actions['activate_plugin'], $install_actions['network_activate'] ); 77 83 } elseif ( ! current_user_can( 'activate_plugin', $plugin_file ) ) {
Note: See TracChangeset
for help on using the changeset viewer.