settings = new Taxonomies_Settings( $this->options ); if ( ! empty( $this->options ) ) { add_action( 'init', [ $this, 'register_custom_taxonomies' ] ); } } /** * 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 ); } } } }