get_id()}_settings", array() ); return $settings[ $key ] ?? $default; } /** * Update module settings. * * @param string $key Setting key. * @param mixed $value Setting value. * @return bool */ public function update_setting( string $key, $value ): bool { $option_name = "aime_{$this->get_id()}_settings"; $settings = get_option( $option_name, array() ); $settings[ $key ] = $value; $updated = update_option( $option_name, $settings, false ); aime_clear_settings_cache( array( $option_name ) ); return $updated; } /** * Save all module settings at once. * * @param array $settings Settings array. * @return bool */ public function save_settings( array $settings ): bool { $option_name = "aime_{$this->get_id()}_settings"; $updated = update_option( $option_name, $settings, false ); aime_clear_settings_cache( array( $option_name ) ); return $updated; } /** * Get all module settings. * * @return array */ public function get_all_settings(): array { return get_option( "aime_{$this->get_id()}_settings", array() ); } /** * Get module configuration for the React dashboard. * * @return array */ public function get_dashboard_config(): array { return array( 'id' => $this->get_id(), 'name' => $this->get_name(), 'description' => $this->get_description(), 'icon' => $this->get_icon(), 'version' => $this->get_version(), ); } }