settings = $settings; } public function register(): void { add_filter( 'wp_robots', array( $this, 'add_noai' ), 98 ); } /** * @param array $robots * * @return array */ public function add_noai( array $robots ): array { if ( ! (bool) $this->settings->get()['noai'] ) { return $robots; } $robots['noai'] = true; $robots['noimageai'] = true; return $robots; } }