Brak opisu

getters.php 991B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit; // Exit if accessed directly
  7. }
  8. /**
  9. * Return the theme id.
  10. *
  11. * @param int $theme_id
  12. *
  13. * @return int
  14. */
  15. function pum_get_theme_id( $theme_id = 0 ) {
  16. if ( ! empty( $theme_id ) && is_numeric( $theme_id ) ) {
  17. $_theme_id = $theme_id;
  18. } elseif ( is_object( pum()->current_theme ) && is_numeric( pum()->current_theme->ID ) ) {
  19. $_theme_id = pum()->current_theme->ID;
  20. } else {
  21. $_theme_id = 0;
  22. }
  23. return (int) apply_filters( 'pum_get_theme_id', (int) $_theme_id, $theme_id );
  24. }
  25. /**
  26. * @param int $theme_id
  27. *
  28. * @return array
  29. */
  30. function pum_get_theme_generated_styles( $theme_id = 0 ) {
  31. $theme = pum_get_theme( $theme_id );
  32. if ( ! pum_is_theme_object( $theme ) ) {
  33. return array();
  34. }
  35. return $theme->get_generated_styles();
  36. }