Fix stale plugin update notice
Some checks failed
Release Plugin Zip / release (push) Has been cancelled
Some checks failed
Release Plugin Zip / release (push) Has been cancelled
This commit is contained in:
@@ -83,11 +83,7 @@ if ( ! class_exists( 'Tony_Sportspress_GitHub_Updater' ) ) {
|
|||||||
$remote_version = $this->normalize_version( $release['version'] );
|
$remote_version = $this->normalize_version( $release['version'] );
|
||||||
$current_version = $this->normalize_version( TONY_SPORTSPRESS_ENHANCEMENTS_VERSION );
|
$current_version = $this->normalize_version( TONY_SPORTSPRESS_ENHANCEMENTS_VERSION );
|
||||||
|
|
||||||
if ( version_compare( $remote_version, $current_version, '<=' ) ) {
|
$plugin_data = (object) array(
|
||||||
return $transient;
|
|
||||||
}
|
|
||||||
|
|
||||||
$transient->response[ $this->plugin_basename ] = (object) array(
|
|
||||||
'id' => $release['url'],
|
'id' => $release['url'],
|
||||||
'slug' => $this->plugin_slug,
|
'slug' => $this->plugin_slug,
|
||||||
'plugin' => $this->plugin_basename,
|
'plugin' => $this->plugin_basename,
|
||||||
@@ -102,6 +98,16 @@ if ( ! class_exists( 'Tony_Sportspress_GitHub_Updater' ) ) {
|
|||||||
'translations' => array(),
|
'translations' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( version_compare( $remote_version, $current_version, '<=' ) ) {
|
||||||
|
unset( $transient->response[ $this->plugin_basename ] );
|
||||||
|
$transient->no_update[ $this->plugin_basename ] = $plugin_data;
|
||||||
|
|
||||||
|
return $transient;
|
||||||
|
}
|
||||||
|
|
||||||
|
unset( $transient->no_update[ $this->plugin_basename ] );
|
||||||
|
$transient->response[ $this->plugin_basename ] = $plugin_data;
|
||||||
|
|
||||||
return $transient;
|
return $transient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user