name = $data['object_name']; $this->script_to_localize = $data['script_name']; $this->app_name = $data['app_name']; $this->display_condition = $data['enqueue']; $this->chunk = $data['chunk']; $this->root_element = $data['root_element']; } /** * Whether we should enqueue this data. * * @since 2.6 * * @return bool|mixed */ public function should_enqueue() { return is_admin(); } /** * Config data. * * @return array[] */ public function data() { return array( 'apps' => array( $this->app_name => array( 'should_display' => is_callable( $this->display_condition ) ? call_user_func( $this->display_condition ) : $this->display_condition, 'chunk_path' => $this->chunk, 'root_element' => $this->root_element, ), ), ); } }