Traits
1 month ago
CTF_About_Us.php
1 month ago
CTF_Admin_Notices.php
1 month ago
CTF_Cache_Handler.php
1 month ago
CTF_Global_Settings.php
1 month ago
CTF_HTTP_Request.php
1 month ago
CTF_New_User.php
1 month ago
CTF_Notifications.php
1 month ago
CTF_Response.php
1 month ago
CTF_Support.php
1 month ago
CTF_Upgrader.php
1 month ago
CTF_View.php
1 month ago
PluginSilentUpgrader.php
1 month ago
PluginSilentUpgraderSkin.php
1 month ago
SB_Twitter_Cache.php
1 month ago
addon-functions.php
1 month ago
class-install-skin.php
1 month ago
class-install-skin.php
26 lines
| 1 | <?php |
| 2 | use CTF\Helpers\PluginSilentUpgraderSkin; |
| 3 | /** |
| 4 | * Skin for on-the-fly addon installations. |
| 5 | * |
| 6 | * @since 1.0.0 |
| 7 | * @since 1.5.6.1 Extend PluginSilentUpgraderSkin and clean up the class. |
| 8 | */ |
| 9 | class CTF_Install_Skin extends PluginSilentUpgraderSkin { |
| 10 | |
| 11 | /** |
| 12 | * Instead of outputting HTML for errors, json_encode the errors and send them |
| 13 | * back to the Ajax script for processing. |
| 14 | * |
| 15 | * @since 1.0.0 |
| 16 | * |
| 17 | * @param array $errors Array of errors with the install process. |
| 18 | */ |
| 19 | public function error( $errors ) { |
| 20 | |
| 21 | if ( ! empty( $errors ) ) { |
| 22 | wp_send_json_error( $errors ); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 |