aders() as $rule ) { $rule->add_hooks(); } } /** * Removes settings for all submodules. */ public function remove_settings() { } /** * Delete all the data & the cache. */ public function remove_data() { } /** * Converts the current object state to an array. * * @return array The array representation of the object. */ public function to_array() { $misc = $this->get_model()->refresh_headers(); return array_slice( $misc, 0, 3 ); } /** * Get data about headers. * * @return array */ public function get_type_headers(): array { return $this->get_model()->get_headers_by_type(); } /** * Provides data for the frontend. * * @return array An array of data for the frontend. */ public function data_frontend(): array { $model = $this->get_model(); return array_merge( array( 'model' => $model->export(), 'misc' => $model->get_headers_as_array( true ), 'enabled' => $model->get_enabled_headers( 3 ), ), $this->dump_routes_and_nonces() ); } /** * Provides data for the dashboard widget. * * @return array An array of dashboard widget data. */ public function dashboard_widget(): array { return array( 'enabled' => $this->get_model()->get_enabled_headers( 3 ) ); } /** * Imports data into the model. * * @param array $data Data to be imported into the model. */ public function import_data( array $data ) { $model = $this->get_model(); $model->import( $data ); if ( $model->validate() ) { $model->save(); } } /** * Exports strings. * * @return array An array of strings. */ public function export_strings(): array { return array( $this->get_model()->is_any_activated() ? esc_html__( 'Active', 'defender-security' ) : esc_html__( 'Inactive', 'defender-security' ), ); } }