WP_Upgrader_Skin::decrement_update_count() – Output JavaScript that calls function to decrement the update counts.

You appear to be a bot. Output may be restricted

Description

Output JavaScript that calls function to decrement the update counts.

Usage

WP_Upgrader_Skin::decrement_update_count( $type );

Parameters

$type
( string ) required – Type of update count to decrement. Likely values include 'plugin', 'theme', 'translation', etc.

Returns

void

Source

File name: wordpress/wp-admin/includes/class-wp-upgrader-skin.php
Lines:

1 to 21 of 21
  protected function decrement_update_count( $type ) {
    if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) {
      return;
    }

    if ( defined( 'IFRAME_REQUEST' ) ) {
      echo '<script type="text/javascript">
					if ( window.postMessage && JSON ) {
						window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );
					}
				</script>';
    } else {
      echo '<script type="text/javascript">
					(function( wp ) {
						if ( wp && wp.updates && wp.updates.decrementCount ) {
							wp.updates.decrementCount( "' . $type . '" );
						}
					})( window.wp );
				</script>';
    }
  }
 

 View on GitHub View on Trac