@@ -16,7 +16,9 @@ |
||
| 16 | 16 | /** |
| 17 | 17 | * Prevent loading the library more than once |
| 18 | 18 | */ |
| 19 | -if( defined( 'AMARKAL_TAXONOMY' ) ) return; |
|
| 19 | +if( defined( 'AMARKAL_TAXONOMY' ) ) { |
|
| 20 | + return; |
|
| 21 | +} |
|
| 20 | 22 | define( 'AMARKAL_TAXONOMY', true ); |
| 21 | 23 | |
| 22 | 24 | /** |
@@ -237,7 +237,7 @@ |
||
| 237 | 237 | /** |
| 238 | 238 | * Treverse the $fields array. |
| 239 | 239 | * |
| 240 | - * @param collable $callback Called on each iteration |
|
| 240 | + * @param \Closure $callback Called on each iteration |
|
| 241 | 241 | */ |
| 242 | 242 | private function traverse_fields( $callback ) |
| 243 | 243 | { |
@@ -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 | /** |