<?php

class FLO_INIT_METABOXES
{
	protected $theme_name;
	protected $version;

	public function __construct()
	{
		if (defined('FLEX_GUTENBERG_THEME_VERSION')) {
			$this->version = FLEX_GUTENBERG_THEME_VERSION;
		} else {
			$this->version = '1.0.0';
		}

		$this->loader_path = dirname(dirname(__FILE__));
		add_action('init', array($this, 'init_metaboxes'));
	}

	public function init_metaboxes()
	{
		$loader_path = $this->loader_path;

		global $public_post_types;

		$public_post_types = get_post_types(array(
			'public' => TRUE
		));

		foreach (glob($loader_path . '/configuration-files/metaboxes/metabox-*.php') as $metabox_config) {
			include $metabox_config;
		}
	}
}

new FLO_INIT_METABOXES();
