Skip to content

Taxonomy Associations

Carlos Moreira edited this page Jun 2, 2020 · 1 revision

The associations parameter in a taxonomy model will define to which post types this particular taxonomy will be associated with.

It can either be an array or a string. It will be used as the second parameter in the register_taxonomy function from WordPress.

Usually you would use one or multiple post types that you create in the same plugin.

Example:

return [
	'type'         => 'category',
	'name'         => 'genre',
	'associations' => [
		'book',
	],
];

Clone this wiki locally