manager ) { $this->manager = new External_Links_Manager(); } return $this->manager; } /** * The stored settings, with the exception list re-indexed. * * @return array */ protected function stored(): array { $settings = $this->manager()->get_settings( 'site' ); $settings['external_link_exceptions'] = array_values( (array) ( $settings['external_link_exceptions'] ?? [] ) ); return $settings; } /** * Schema for the three settings. * * @return array */ protected function settings_properties(): array { return [ 'nofollow_external' => [ 'type' => 'boolean', 'description' => __( 'Add rel="nofollow" to every link pointing at another domain.', 'thinkrank' ), ], 'open_external_in_new_tab' => [ 'type' => 'boolean', 'description' => __( 'Add target="_blank" to external links, along with the rel="noopener" it requires.', 'thinkrank' ), ], 'external_link_exceptions' => [ 'type' => 'array', 'items' => [ 'type' => 'string' ], 'description' => __( 'Hosts neither switch touches. A full URL or a "www." prefix is accepted and reduced to the host it matches on, so read the value back rather than assuming what was stored. Subdomains of a listed host are included.', 'thinkrank' ), ], ]; } }