Changeset 27280 for trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
- Timestamp:
- 02/26/2014 06:54:26 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
r26518 r27280 93 93 function after() {} 94 94 95 /** 96 * Output JavaScript that calls function to decrement the update counts. 97 * 98 * @since 3.9.0 99 */ 100 protected function decrement_update_count( $type ) { 101 if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) { 102 return; 103 } 104 echo '<script type="text/javascript"> 105 (function( wp ) { 106 if ( wp && wp.updates.decrementCount ) { 107 wp.updates.decrementCount( "' . $type . '" ); 108 } 109 })( window.wp ); 110 </script>'; 111 } 95 112 } 96 113 … … 124 141 echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) .'"></iframe>'; 125 142 } 143 144 $this->decrement_update_count( 'plugin' ); 126 145 127 146 $update_actions = array( … … 253 272 flush(); 254 273 } 274 275 /** 276 * Output JavaScript that sends message to parent window to decrement the update counts. 277 * 278 * @since 3.9.0 279 */ 280 protected function decrement_update_count( $type ) { 281 if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) { 282 return; 283 } 284 echo '<script type="text/javascript"> 285 if ( window.postMessage && JSON ) { 286 window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname ); 287 } 288 </script>'; 289 } 255 290 } 256 291 … … 273 308 function after($title = '') { 274 309 parent::after($this->plugin_info['Title']); 310 $this->decrement_update_count( 'plugin' ); 275 311 } 276 312 function bulk_footer() { … … 307 343 function after($title = '') { 308 344 parent::after( $this->theme_info->display('Name') ); 345 $this->decrement_update_count( 'theme' ); 309 346 } 310 347 … … 480 517 481 518 function after() { 519 $this->decrement_update_count( 'theme' ); 482 520 483 521 $update_actions = array(); … … 562 600 563 601 function bulk_footer() { 602 $this->decrement_update_count( 'translation' ); 564 603 $update_actions = array(); 565 604 $update_actions['updates_page'] = '<a href="' . self_admin_url( 'update-core.php' ) . '" title="' . esc_attr__( 'Go to WordPress Updates page' ) . '" target="_parent">' . __( 'Return to WordPress Updates' ) . '</a>';
Note: See TracChangeset
for help on using the changeset viewer.