public/wordpress/wp-content/plugins/wp-courseware/includes/core/updater.php
/**
	 * Check for Updates at the defined API endpoint and modify the update array.
	 *
	 * This function dives into the update API just when WordPress creates its update array,
	 * then adds a custom API call and injects the custom plugin data retrieved from the API.
	 * It is reassembled from parts of the native WordPress plugin update code.
	 * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
	 *
	 * @since 1.6.15
	 *
	 * @uses api_request()
	 *
	 * @param array $_transient_data Update array build by WordPress.
	 *
	 * @return array Modified update array with custom plugin data.
	 */
Check for Updates at the defined API endpoint and modify the update array.
This function dives into the update API just when WordPress creates its update array,
then adds a custom API call and injects the custom plugin data retrieved from the API.
It is reassembled from parts of the native WordPress plugin update code.
See wp-includes/update.php line 121 for the original wp_update_plugins() function.





@param array $_transient_data Update array build by WordPress.

@return array Modified update array with custom plugin data.
Check for Updates at the defined API endpoint and modify the update array . This function dives into the update API just when WordPress creates its update array then adds a custom API call and injects the custom plugin data retrieved from the API . It is reassembled from parts of the native WordPress plugin update code . See wp - includes / update . php line 121 for the original wp_update_plugins () function . @param array $_transient_data Update array build by WordPress . @return array Modified update array with custom plugin data .
public function check_update( $_transient_data ) {
		global $pagenow;
		if ( ! is_object( $_transient_data ) ) {
			$_transient_data = new stdClass;
		}
		if ( 'plugins.php' == $pagenow && is_multisite() ) {
			return $_transient_data;
		}
		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
			return $_transient_data;
		}
		$version_info = $this->get_cached_version_info();
		if ( false === $version_info ) {
			$version_info = $this->api_request( 'plugin_latest_version', array(
				'slug' => $this->slug,
				'beta' => $this->beta,
			) );
			$this->set_version_info_cache( $version_info );
		}
		if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
			if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
				$_transient_data->response[ $this->name ] = $version_info;
			}
			$_transient_data->last_checked           = current_time( 'timestamp' );
			$_transient_data->checked[ $this->name ] = $this->version;
		}
		if ( ! empty( $_transient_data->response[ $this->name ] ) ) {
			if ( ! isset( $_transient_data->response[ $this->name ]->tested ) ) {
				$_transient_data->response[ $this->name ]->tested = defined( 'WPCW_TESTED_WP_VERSION' ) ? WPCW_TESTED_WP_VERSION : get_bloginfo( 'version' );
			}
		}
		return $_transient_data;
	}
public function check_update ( $ _transient_data ) { global $ pagenow ; if ( ! is_object ( $ _transient_data ) ) { $ _transient_data = new stdClass ; } if ( 'plugins.php' == $ pagenow && is_multisite ( ) ) { return $ _transient_data ; } if ( ! empty ( $ _transient_data -> response ) && ! empty ( $ _transient_data -> response [ $ this -> name ] ) && false === $ this -> wp_override ) { return $ _transient_data ; } $ version_info = $ this -> get_cached_version_info ( ) ; if ( false === $ version_info ) { $ version_info = $ this -> api_request ( 'plugin_latest_version' , array ( 'slug' => $ this -> slug , 'beta' => $ this -> beta , ) ) ; $ this -> set_version_info_cache ( $ version_info ) ; } if ( false !== $ version_info && is_object ( $ version_info ) && isset ( $ version_info -> new_version ) ) { if ( version_compare ( $ this -> version , $ version_info -> new_version , '<' ) ) { $ _transient_data -> response [ $ this -> name ] = $ version_info ; } $ _transient_data -> last_checked = current_time ( 'timestamp' ) ; $ _transient_data -> checked [ $ this -> name ] = $ this -> version ; } if ( ! empty ( $ _transient_data -> response [ $ this -> name ] ) ) { if ( ! isset ( $ _transient_data -> response [ $ this -> name ] -> tested ) ) { $ _transient_data -> response [ $ this -> name ] -> tested = defined ( 'WPCW_TESTED_WP_VERSION' ) ? WPCW_TESTED_WP_VERSION : get_bloginfo ( 'version' ) ; } } return $ _transient_data ; }
Check for Updates at the defined API endpoint and modify the update array.
Check for Updates at the defined API endpoint and modify the update array .