-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/refresh-auth
- Loading branch information
Showing
3 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,11 @@ public function __construct() { | |
* @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 @@ public function settings_link( $links ) { | |
$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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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'] ) | ||
); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters