Blocks
3 weeks ago
Traits
3 weeks ago
CFF_About_Us.php
3 weeks ago
CFF_Admin.php
3 weeks ago
CFF_Admin_Notices.php
3 weeks ago
CFF_Callout.php
3 weeks ago
CFF_Global_Settings.php
3 weeks ago
CFF_Install_Skin.php
3 weeks ago
CFF_New_User.php
3 weeks ago
CFF_Notifications.php
3 weeks ago
CFF_Onboarding_Wizard.php
3 weeks ago
CFF_Support.php
3 weeks ago
CFF_Support_Tool.php
3 weeks ago
CFF_Upgrader.php
3 weeks ago
CFF_oEmbeds.php
3 weeks ago
index.php
3 weeks ago
CFF_Install_Skin.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | namespace CustomFacebookFeed\Admin; |
| 4 | |
| 5 | use CustomFacebookFeed\Helpers\PluginSilentUpgraderSkin; |
| 6 | |
| 7 | if (!defined('ABSPATH')) { |
| 8 | exit; // Exit if accessed directly |
| 9 | } |
| 10 | |
| 11 | /** |
| 12 | * Skin for on-the-fly addon installations. |
| 13 | * |
| 14 | * @since 1.0.0 |
| 15 | * @since 1.5.6.1 Extend PluginSilentUpgraderSkin and clean up the class. |
| 16 | */ |
| 17 | class CFF_Install_Skin extends PluginSilentUpgraderSkin |
| 18 | { |
| 19 | /** |
| 20 | * Instead of outputting HTML for errors, json_encode the errors and send them |
| 21 | * back to the Ajax script for processing. |
| 22 | * |
| 23 | * @since 1.0.0 |
| 24 | * |
| 25 | * @param array $errors Array of errors with the install process. |
| 26 | */ |
| 27 | public function error($errors) |
| 28 | { |
| 29 | |
| 30 | if (! empty($errors)) { |
| 31 | wp_send_json_error($errors); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 |