register_settings( aiou()->settings() ); ( new Feature() )->register(); } /** * Register the "Feeds" section. * * @param SettingsRegistry $settings The settings registry. * @return void */ private function register_settings( SettingsRegistry $settings ): void { $settings->add_section( 'performance', 'feeds', __( 'Feeds', 'all-in-one-utilities' ), __( 'RSS/Atom/RDF feeds are only useful if people actually subscribe to your content. If you run WordPress mainly as a CMS, they\'re pure overhead.', 'all-in-one-utilities' ), 70 ); $settings->add_field( 'performance', 'feeds', new Field( id: 'enabled', label: __( 'Disable feeds', 'all-in-one-utilities' ), type: 'checkbox', default: 0, args: array( 'toggle_label' => __( 'Block every RSS/Atom/RDF feed request and remove feed discovery links from the page head', 'all-in-one-utilities' ) ), priority: 10 ) ); $settings->add_field( 'performance', 'feeds', new Field( id: 'mode', label: __( 'When a feed is requested', 'all-in-one-utilities' ), type: 'select', default: 'redirect', args: array( 'choices' => array( 'redirect' => __( 'Redirect to the matching page', 'all-in-one-utilities' ), '404' => __( 'Return a 404 Not Found', 'all-in-one-utilities' ), ), 'depends_on' => 'enabled', ), doc: new Doc( title: __( 'Redirect vs. 404', 'all-in-one-utilities' ), short: __( 'Redirecting sends visitors (and search engines) to the normal page instead of a dead end; a 404 is more blunt but makes it unambiguous that the feed itself no longer exists.', 'all-in-one-utilities' ) ), priority: 20 ) ); $settings->add_field( 'performance', 'feeds', new Field( id: 'allow_main', label: __( 'Keep the main site feeds', 'all-in-one-utilities' ), type: 'checkbox', default: 0, args: array( 'toggle_label' => __( 'Still allow the global post feed and global comment feed; disable every other feed (categories, tags, authors, search, individual post comments, etc.)', 'all-in-one-utilities' ), 'depends_on' => 'enabled', ), priority: 30 ) ); } }