Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Refactor code to skip existing taxonomies and post types
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Secchi committed Sep 6, 2024
1 parent b465ffd commit 5fd8e19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/api/class-register-post-taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function register_custom_taxonomies() {

foreach ( apply_filters( "{$this->prefix}_add_custom_taxonomies", array() ) as $taxonomy => $args ) {
if ( taxonomy_exists( $taxonomy ) ) {
return;
continue;
}

$args = array_merge( $default_args, $args );
Expand Down
2 changes: 1 addition & 1 deletion includes/api/class-register-post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function register_post_types() {

foreach ( apply_filters( "{$this->prefix}_add_custom_post_types", array() ) as $post_type => $args ) {
if ( post_type_exists( $post_type ) ) {
return;
continue;
}

$args = array_merge( $default_args, $args );
Expand Down

0 comments on commit 5fd8e19

Please sign in to comment.