@@ -63,8 +63,9 @@ |
||
| 63 | 63 | if( !isset($this->fields[$taxonomy_name][$field_name])) |
| 64 | 64 | { |
| 65 | 65 | $this->fields[$taxonomy_name][$field_name] = array_merge( $this->default_props(), $field_props ); |
| 66 | + } else { |
|
| 67 | + throw new \RuntimeException("A field named '$field_name' has already been registered in '$taxonomy_name'"); |
|
| 66 | 68 | } |
| 67 | - else throw new \RuntimeException("A field named '$field_name' has already been registered in '$taxonomy_name'"); |
|
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | /** |
@@ -18,7 +18,9 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Prevent loading the library more than once |
| 20 | 20 | */ |
| 21 | -if( defined( 'AMARKAL_TAXONOMY' ) ) return false; |
|
| 21 | +if( defined( 'AMARKAL_TAXONOMY' ) ) { |
|
| 22 | + return false; |
|
| 23 | +} |
|
| 22 | 24 | define( 'AMARKAL_TAXONOMY', true ); |
| 23 | 25 | |
| 24 | 26 | if(!function_exists('amarkal_taxonomy_add_field')) |