aristath /
kirki
| 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 http://opensource.org/licenses/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_attr_e( 'Important Upgrade Notice:', 'kirki' ); ?></strong> |
||||||||
|
1 ignored issue
–
show
The function
esc_attr_e was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 31 | <?php $upgrade_notice = wp_strip_all_tags( $response->upgrade_notice ); ?> |
||||||||
|
1 ignored issue
–
show
The function
wp_strip_all_tags was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 32 | <?php echo esc_html( $upgrade_notice ); ?> |
||||||||
|
1 ignored issue
–
show
The function
esc_html was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 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 ); |
||||||||
|
2 ignored issues
–
show
The function
plugin_basename was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
The function
add_action was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 39 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.