mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-19 06:34:03 +09:00
Merge branch 'master' into feature/refresh-auth
This commit is contained in:
@@ -34,9 +34,11 @@ class WPStrava_Settings {
|
||||
* @since 0.62
|
||||
*/
|
||||
public function hook() {
|
||||
add_action( 'admin_init', array( $this, 'register_strava_settings' ), 20 );
|
||||
add_action( 'admin_init', array( $this, 'register_strava_settings' ) );
|
||||
add_action( 'admin_menu', array( $this, 'add_strava_menu' ) );
|
||||
add_filter( 'plugin_action_links_' . WPSTRAVA_PLUGIN_NAME, array( $this, 'settings_link' ) );
|
||||
add_action( 'in_plugin_update_message-wp-strava/wp-strava.php', array( $this, 'plugin_update_message' ), 10, 2 );
|
||||
add_action( 'after_plugin_row_wp-strava/wp-strava.php', array( $this, 'ms_plugin_update_message' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -699,4 +701,39 @@ class WPStrava_Settings {
|
||||
$links[] = $settings_link;
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin Upgrade Notice.
|
||||
*
|
||||
* @param array $data Plugin data with readme additions.
|
||||
* @param array $response Response from wp.org.
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since 1.7.3
|
||||
*/
|
||||
public function plugin_update_message( $data, $response ) {
|
||||
if ( isset( $data['upgrade_notice'] ) ) {
|
||||
echo wp_kses_post( $data['upgrade_notice'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin Upgrade Notice (multisite).
|
||||
*
|
||||
* @param string $file Relative path to plugin, i.e. wp-strava/wp-strava.php.
|
||||
* @param array $plugin Plugin data with readme additions.
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since 1.7.3
|
||||
*/
|
||||
public function ms_plugin_update_message( $file, $plugin ) {
|
||||
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'],
|
||||
wp_kses_post( $plugin['upgrade_notice'] )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user