Нема описа

Popups.php 887B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit;
  7. }
  8. /**
  9. * Class Post_Types
  10. */
  11. class PUM_Popups {
  12. /**
  13. * Hook the initialize method to the WP init action.
  14. */
  15. public static function init() {
  16. }
  17. /**
  18. * @deprecated 1.8.0
  19. * @remove 1.9.0
  20. *
  21. * @return \WP_Query
  22. */
  23. public static function get_all() {
  24. static $query;
  25. if ( ! isset( $query ) ) {
  26. $query = self::query();
  27. }
  28. return $query;
  29. }
  30. /**
  31. * @deprecated 1.8.0
  32. * @remove 1.9.0
  33. *
  34. * @return \WP_Query
  35. */
  36. public static function query( $args = array() ) {
  37. $args = wp_parse_args( $args, array(
  38. 'post_type' => 'popup',
  39. 'posts_per_page' => - 1,
  40. ) );
  41. return new WP_Query( $args );
  42. }
  43. }