Aucune description

Popups.php 992B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit;
  7. }
  8. /**
  9. * Implements a batch processor for migrating existing popups to new data structure.
  10. *
  11. * @since 1.7.0
  12. *
  13. * @see PUM_Abstract_Upgrade
  14. * @see PUM_Interface_Batch_PrefetchProcess
  15. * @see PUM_Interface_Upgrade_Posts
  16. */
  17. abstract class PUM_Abstract_Upgrade_Popups extends PUM_Abstract_Upgrade_Posts implements PUM_Interface_Upgrade_Posts {
  18. /**
  19. * Post type.
  20. *
  21. * @var string
  22. */
  23. public $post_type = 'popup';
  24. /**
  25. * Process needed upgrades on each post.
  26. *
  27. * @param int $post_id
  28. */
  29. public function process_post( $post_id = 0 ) {
  30. $this->process_popup( $post_id );
  31. }
  32. /**
  33. * Process needed upgrades on each popup.
  34. *
  35. * @param int $popup_id
  36. */
  37. abstract public function process_popup( $popup_id = 0 );
  38. }