1 | <?php |
||
2 | /** |
||
3 | * Adds upgrade notifications. |
||
4 | * |
||
5 | * @package Kirki |
||
6 | * @category Core |
||
7 | * @author Aristeides Stathopoulos |
||
8 | * @copyright Copyright (c) 2017, Aristeides Stathopoulos |
||
9 | * @license https://opensource.org/licenses/MIT |
||
10 | * @since 3.0.0 |
||
11 | */ |
||
12 | |||
13 | if ( ! function_exists( 'kirki_show_upgrade_notification' ) ) : |
||
14 | /** |
||
15 | * Fires at the end of the update message container in each |
||
16 | * row of the plugins list table. |
||
17 | * Allows us to add important notices about updates should they be needed. |
||
18 | * Notices should be added using "== Upgrade Notice ==" in readme.txt. |
||
19 | * |
||
20 | * @since 2.3.8 |
||
21 | * @param array $plugin_data An array of plugin metadata. |
||
22 | * @param array $response An array of metadata about the available plugin update. |
||
23 | */ |
||
24 | function kirki_show_upgrade_notification( $plugin_data, $response ) { |
||
0 ignored issues
–
show
|
|||
25 | |||
26 | // Check "upgrade_notice". |
||
27 | if ( isset( $response->upgrade_notice ) && strlen( trim( $response->upgrade_notice ) ) > 0 ) : ?> |
||
28 | <style>.kirki-upgrade-notification {background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px;margin-bottom:10px;}.kirki-upgrade-notification + p {display:none;}</style> |
||
29 | <div class="kirki-upgrade-notification"> |
||
30 | <strong><?php esc_html_e( 'Important Upgrade Notice:', 'kirki' ); ?></strong> |
||
31 | <?php $upgrade_notice = wp_strip_all_tags( $response->upgrade_notice ); ?> |
||
32 | <?php echo esc_html( $upgrade_notice ); ?> |
||
33 | </div> |
||
34 | <?php |
||
35 | endif; |
||
36 | } |
||
37 | endif; |
||
38 | add_action( 'in_plugin_update_message-' . plugin_basename( __FILE__ ), 'kirki_show_upgrade_notification', 10, 2 ); |
||
39 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.