説明なし

Config.php 701B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit;
  7. }
  8. /**
  9. * Class PUM_Utils_Config
  10. */
  11. class PUM_Utils_Config {
  12. /**
  13. * Config
  14. *
  15. * @param $file_name
  16. *
  17. * @return mixed
  18. */
  19. public static function load( $file_name ) {
  20. $file_name = str_replace( '\\', DIRECTORY_SEPARATOR, $file_name );
  21. $file = plugin_dir_path( __DIR__ ) . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . $file_name . '.php';
  22. if ( ! file_exists( $file ) ) {
  23. return array();
  24. }
  25. return include $file;
  26. }
  27. }