= count( $data ) //|| did_action( 'widgets_init' ) ) { throw new AceException( esc_html__( 'Failed to initialize the widget area.', 'ace' ) ); } $this->initVars( $id, $data ); $this->initHooks(); } /** * Init vars * @param array $data **/ protected function initVars( $id, $data ) { $this->id = $id; $this->data = $data; } /** * Init hooks **/ protected function initHooks() { } /** * Register sidebar * @param array $data **/ public function registerSidebar() { if ( ! in_array( current_filter(), array( 'widgets_init' ) ) ) { return; } register_sidebar( $this->data ); } /** * Getters **/ /** * Get ID **/ public function getId() { return $this->id; } /** * Get Data **/ public function getData() { return $this->data; } }