Wallmander\ElasticsearchIndexer\Model\Config::load PHP Method

load() public static method

Fetch config array from a file in the config directory.
public static load ( string $config ) : array
$config string
return array
    public static function load($config)
    {
        return require ESI_PATH . 'config/' . $config . '.php';
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Hooked on admin_init. Registers the options and enqueues admin style and javascript.
  */
 public static function actionAdminInit()
 {
     wp_enqueue_style('elasticsearch-indexer', ESI_URL . 'assets/admin/style.css');
     wp_enqueue_script('elasticsearch-indexer', ESI_URL . 'assets/admin/script.js', ['jquery']);
     foreach (Config::load('defaults') as $key => $value) {
         register_setting('esi_options_group', Config::OPTION_PREFIX . $key);
     }
 }
All Usage Examples Of Wallmander\ElasticsearchIndexer\Model\Config::load