* Theme restriction. */ $access = $theme['config']->get('theme.access'); if (!empty($access) && is_array($access)) { $theme['action']->add('init', 'themosis_theme_restrict'); } /* * Theme templates. */ $templates = new Themosis\Config\Template($theme['config']->get('templates'), $theme['filter']); $templates->make(); /* * Theme image sizes. */ $images = new Themosis\Config\Images($theme['config']->get('images'), $theme['filter']); $images->make(); /* * Theme menus. */ $menus = new Themosis\Config\Menu($theme['config']->get('menus')); $menus->make(); /* * Theme sidebars. */ $sidebars = new Themosis\Config\Sidebar($theme['config']->get('sidebars')); $sidebars->make(); /* * Theme supports. */ $supports = new Themosis\Config\Support($theme['config']->get('supports')); $supports->make();
/** * Setup core framework parameters. * At this moment, all activated plugins have been loaded. * Each plugin has its service providers registered. */ protected function setup() { /* * Add view paths. */ $viewFinder = $this->container['view.finder']; $viewFinder->addLocation(themosis_path('sys') . 'Metabox' . DS . 'Views'); $viewFinder->addLocation(themosis_path('sys') . 'Page' . DS . 'Views'); $viewFinder->addLocation(themosis_path('sys') . 'PostType' . DS . 'Views'); $viewFinder->addLocation(themosis_path('sys') . 'Field' . DS . 'Fields' . DS . 'Views'); $viewFinder->addLocation(themosis_path('sys') . 'Taxonomy' . DS . 'Views'); $viewFinder->addLocation(themosis_path('sys') . 'User' . DS . 'Views'); /* * Add paths to asset finder. */ $url = plugins_url('src/Themosis/_assets', __FILE__); $assetFinder = $this->container['asset.finder']; $assetFinder->addPaths([$url => themosis_path('sys') . '_assets']); /* * Add framework core assets URL to the global * admin JS object. */ add_filter('themosisAdminGlobalObject', function ($data) use($url) { $data['_themosisAssets'] = $url; return $data; }); /* * Register framework media image size. */ $images = new Themosis\Config\Images(['_themosis_media' => [100, 100, true, __('Mini', THEMOSIS_FRAMEWORK_TEXTDOMAIN)]], $this->container['filter']); $images->make(); /* * Register framework assets. */ $this->container['asset']->add('themosis-core-styles', 'css/_themosisCore.css', ['wp-color-picker'])->to('admin'); $this->container['asset']->add('themosis-core-scripts', 'js/_themosisCore.js', ['jquery', 'jquery-ui-sortable', 'underscore', 'backbone', 'mce-view', 'wp-color-picker'], '1.3.0', true)->to('admin'); }