Updated upgrade notice and display

This commit is contained in:
Justin Foell
2019-09-21 23:17:17 -05:00
parent 0a2093db17
commit cabbd83322
2 changed files with 7 additions and 9 deletions
+3 -7
View File
@@ -711,14 +711,10 @@ class WPStrava_Settings {
* @param array $response Response from wp.org.
* @author Justin Foell <justin.foell@webdevstudios.com>
* @since 1.7.3
* @see https://wisdomplugin.com/add-inline-plugin-update-message/
*/
public function plugin_update_message( $data, $response ) {
if ( isset( $data['upgrade_notice'] ) ) {
printf(
'<div class="update-message">%s</div>',
wpautop( $data['upgrade_notice'] )
);
echo wp_kses_post( $data['upgrade_notice'] );
}
}
@@ -731,13 +727,13 @@ class WPStrava_Settings {
* @since 1.7.3
*/
public function ms_plugin_update_message( $file, $plugin ) {
if ( is_multisite() && version_compare( $plugin['Version'], $plugin['new_version'], '<' ) ) {
if ( is_multisite() && ! is_network_admin() && version_compare( $plugin['Version'], $plugin['new_version'], '<' ) ) {
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
printf(
'<tr class="plugin-update-tr"><td colspan="%s" class="plugin-update update-message notice inline notice-warning notice-alt"><div class="update-message"><h4 style="margin: 0; font-size: 14px;">%s</h4>%s</div></td></tr>',
$wp_list_table->get_column_count(),
$plugin['Name'],
wpautop( $plugin['upgrade_notice'] )
wp_kses_post( $plugin['upgrade_notice'] )
);
}
}
Regular → Executable
+4 -2
View File
@@ -233,6 +233,8 @@ Added option to select unit of measurements on the widget. https://wordpress.org
Initial version.
== upgrade_notice ==
== Upgrade Notice ==
The version 2.0 upgrade is coming soon and will be mandatory to use the Strava API after October 15th, 2019. To participate in the 2.0 beta program please visit https://github.com/cmanon/wp-strava/releases. After upgrading to version 2.0, you must upgrade your settings to continue to use WP-Strava 2.0. See https://github.com/cmanon/wp-strava/wiki/2.0-Upgrade.
= 1.7.3 =
Version 2.0 will be mandatory after October 15th, 2019. Try the 2.0 beta: <a href="https://github.com/cmanon/wp-strava/releases">https://github.com/cmanon/wp-strava/releases</a>. 2.0 settings upgrade instructions: <a href="https://github.com/cmanon/wp-strava/wiki/2.0-Upgrade">https://github.com/cmanon/wp-strava/wiki/2.0-Upgrade</a>.