settings = new Taxonomies_Settings( $this->options ); if ( ! empty( $this->options ) ) { add_action( 'init', [ $this, 'register_custom_taxonomies' ] ); } add_filter( 'adminoptim_notification_message_' . self::MODULE_SLUG, static function ( string $message, string $display ): string { if ( 'banner' === $display ) { return sprintf( /* translators: 1: Opening strong tag, 2: Closing strong tag. */ __( '%1$sOrganizing content your way?%2$s Leave a ★★★★★ review on WordPress.org and help others discover Admin Optimizer.', 'admin-optimizer' ), '', '' ); } return $message; }, 10, 2 ); } /** * This module's settings page is owned by the Custom Fields & Types section. */ protected function get_submenu_config(): ?array { return null; } /** * Render the settings page * * @return void */ public function render_settings_page() { $this->settings->render_settings_page(); } /** * Register custom taxonomies * * @return void */ public function register_custom_taxonomies() { if ( ! empty( $this->options ) ) { foreach ( $this->options as $slug => $taxonomy_arg ) { $post_types = $taxonomy_arg['posttypes'] ?? []; unset( $taxonomy_arg['posttypes'], $taxonomy_arg['slug'], $taxonomy_arg['use_rewrite'] ); register_taxonomy( $slug, $post_types, $taxonomy_arg ); } } } }