PPress_Install_Skin.php
5 years ago
PluginSilentUpgrader.php
5 years ago
PluginSilentUpgraderSkin.php
5 years ago
index.php
3 years ago
PPress_Install_Skin.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Classes\Installer; |
| 4 | |
| 5 | /** |
| 6 | * Skin for on-the-fly addon installations. |
| 7 | * |
| 8 | * @since 1.5.6.1 Extend PluginSilentUpgraderSkin and clean up the class. |
| 9 | */ |
| 10 | class PPress_Install_Skin extends PluginSilentUpgraderSkin { |
| 11 | |
| 12 | /** |
| 13 | * Instead of outputting HTML for errors, json_encode the errors and send them |
| 14 | * back to the Ajax script for processing. |
| 15 | * |
| 16 | * @since 1.0.0 |
| 17 | * |
| 18 | * @param array $errors Array of errors with the install process. |
| 19 | */ |
| 20 | public function error( $errors ) { |
| 21 | |
| 22 | if ( ! empty( $errors ) ) { |
| 23 | wp_send_json_error( $errors ); |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 |