Skip to content

Commit

Permalink
Fix null warning notice
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatrangnet authored and rilwis committed Feb 2, 2024
1 parent 65226cd commit d4f3687
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PostTypeRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 4 additions & 0 deletions src/TaxonomyRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d4f3687

Please sign in to comment.