暫無描述

class-install-skin.php 598B

12345678910111213141516171819202122232425262728
  1. <?php
  2. use WPForms\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 WPForms_Install_Skin extends PluginSilentUpgraderSkin {
  10. /**
  11. * Instead of outputting HTML for errors, json_encode the errors and send them
  12. * back to the Ajax script for processing.
  13. *
  14. * @since 1.0.0
  15. *
  16. * @param array $errors Array of errors with the install process.
  17. */
  18. public function error( $errors ) {
  19. if ( ! empty( $errors ) ) {
  20. wp_send_json_error( $errors );
  21. }
  22. }
  23. }