Changeset 29357
- Timestamp:
- 08/02/2014 02:36:31 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
r29313 r29357 105 105 return; 106 106 } 107 echo '<script type="text/javascript"> 108 (function( wp ) { 109 if ( wp && wp.updates.decrementCount ) { 110 wp.updates.decrementCount( "' . $type . '" ); 107 108 if ( defined( 'IFRAME_REQUEST' ) ) { 109 echo '<script type="text/javascript"> 110 if ( window.postMessage && JSON ) { 111 window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname ); 111 112 } 112 })( window.wp ); 113 </script>'; 113 </script>'; 114 } else { 115 echo '<script type="text/javascript"> 116 (function( wp ) { 117 if ( wp && wp.updates.decrementCount ) { 118 wp.updates.decrementCount( "' . $type . '" ); 119 } 120 })( window.wp ); 121 </script>'; 122 } 114 123 } 115 124 } … … 284 293 wp_ob_end_flush_all(); 285 294 flush(); 286 }287 288 /**289 * Output JavaScript that sends message to parent window to decrement the update counts.290 *291 * @since 3.9.0292 *293 * @param string $type Type of update count to decrement. Likely values include 'plugin',294 * 'theme', 'translation', etc.295 */296 protected function decrement_update_count( $type ) {297 if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) {298 return;299 }300 echo '<script type="text/javascript">301 if ( window.postMessage && JSON ) {302 window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );303 }304 </script>';305 295 } 306 296 }
Note: See TracChangeset
for help on using the changeset viewer.