How to get custom post type categories in an array
I want to get all categories (custom taxonomy) in array from a specific post type. The taxonomy (category) registered for a specific post type only. And I want to retrieve all categories in an array.
Be like –
array( 'Category Name 1' => 'slug-name-1', 'Category Name 2' => 'slug-name-2', 'Category Name 3' => 'slug-name-3', );
It can be get category names by slug or id.