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