No Description

conditionals.php 713B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit; // Exit if accessed directly
  7. }
  8. /**
  9. * Checks if the $theme is valid.
  10. *
  11. * @param mixed|PUM_Model_Theme $theme
  12. *
  13. * @return bool
  14. */
  15. function pum_is_theme( $theme ) {
  16. return is_object( $theme ) && is_numeric( $theme->ID ) && $theme->is_valid();
  17. }
  18. /**
  19. * Tests a given value to see if its a valid Theme model.
  20. *
  21. * @param mixed|PUM_Model_Theme $theme
  22. *
  23. * @return bool
  24. */
  25. function pum_is_theme_object( $theme ) {
  26. return is_a( $theme, 'PUM_Model_Theme' );
  27. }