diff --git a/src/PostTypeRegister.php b/src/PostTypeRegister.php index aac0cda..2f8522d 100644 --- a/src/PostTypeRegister.php +++ b/src/PostTypeRegister.php @@ -85,6 +85,10 @@ public function get_post_types() { foreach ( $posts as $post ) { $settings = $this->get_post_type_settings( $post ); + if ( empty( $settings ) ) { + continue; + } + $post_types[ $settings['slug'] ] = $settings; } diff --git a/src/TaxonomyRegister.php b/src/TaxonomyRegister.php index 45e3988..81977e0 100644 --- a/src/TaxonomyRegister.php +++ b/src/TaxonomyRegister.php @@ -114,6 +114,10 @@ public function get_taxonomies() { foreach ( $posts as $post ) { $data = $this->get_taxonomy_data( $post ); + if ( empty( $data ) ) { + continue; + } + $taxonomies[ $data['slug'] ] = $data; }