Bez popisu

Themes.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 popup themes 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_Themes extends PUM_Abstract_Upgrade_Posts implements PUM_Interface_Upgrade_Posts {
  18. /**
  19. * Post type.
  20. *
  21. * @var string
  22. */
  23. public $post_type = 'popup_theme';
  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_theme( $post_id );
  31. }
  32. /**
  33. * Process needed upgrades on each popup theme.
  34. *
  35. * @param int $theme_id
  36. *
  37. * @return int $theme_id
  38. */
  39. abstract public function process_theme( $theme_id = 0 );
  40. }