| 1 |
import BaseModel from './base-model'; |
| 2 |
|
| 3 |
export const taxonomyType = [ |
| 4 |
{ |
| 5 |
key: 'categories', |
| 6 |
label: __( 'Categories', 'elementor' ), |
| 7 |
isOpenByDefault: true, |
| 8 |
}, |
| 9 |
{ |
| 10 |
key: 'tags', |
| 11 |
label: __( 'Tags', 'elementor' ), |
| 12 |
}, |
| 13 |
{ |
| 14 |
key: 'features', |
| 15 |
label: __( 'Features', 'elementor' ), |
| 16 |
}, |
| 17 |
{ |
| 18 |
key: 'subscription_plans', |
| 19 |
label: __( 'Kits by plan', 'elementor' ), |
| 20 |
}, |
| 21 |
]; |
| 22 |
|
| 23 |
export default class Taxonomy extends BaseModel { |
| 24 |
text = ''; |
| 25 |
type = 'tag'; |
| 26 |
|
| 27 |
/** |
| 28 |
* Create a tag from server response |
| 29 |
* |
| 30 |
* @param {Taxonomy} taxonomy |
| 31 |
*/ |
| 32 |
static createFromResponse( taxonomy ) { |
| 33 |
return new Taxonomy().init( { |
| 34 |
text: taxonomy.text, |
| 35 |
type: taxonomy.type, |
| 36 |
} ); |
| 37 |
} |
| 38 |
} |
| 39 |
|