registry = new Registry(); $this->schema = new Schema( $this->registry ); $this->store = new LayoutStore( $this->schema ); $this->assets = new Assets( $this->registry, $this->store ); $this->cache = new ItemCache(); $this->renderer = new Renderer( $this->registry, $this->schema, $this->store, $this->assets, $this->cache ); $shortcode = new Shortcode( $this->renderer ); $controller = new Controller( $this->store, $this->schema, $this->renderer, $this->assets ); add_action( 'init', array( PostType::class, 'register' ) ); add_action( 'init', array( $shortcode, 'register' ) ); add_action( 'rest_api_init', array( $controller, 'register_routes' ) ); add_action( 'wp_enqueue_scripts', array( $this->assets, 'register' ), 5 ); add_action( 'wp_enqueue_scripts', array( $this->assets, 'enqueue_for_current_post' ) ); $this->cache->hooks(); if ( is_admin() ) { ( new Admin\Page() )->hooks(); } } /** * Source, layout and skin registry. * * @return Registry */ public function registry() { return $this->registry; } /** * Saved layout storage. * * @return LayoutStore */ public function store() { return $this->store; } /** * Renderer. * * @return Renderer */ public function renderer() { return $this->renderer; } }