get_terms from registered taxonomies not working

There are just a couple of things I want to point out here using get_terms

  • No need to put one value into an array, you can simply just add the value as is to the variable

  • To return your terms, you have to actually have posts assigned to them. By default, empty terms are hidden. The same goes for get_categories. If you need to show empty terms as well, just set the hide_empty parameter to false

  • You don’t need to call the default values. If you are not going to change the value of a parameter, don’t add it to your arguments. Just add those parameters that you are going to change

Here is a proper example

$args = array(
    'hide_empty' => false, 
);

$terms = get_terms('project', $args);
var_dump($terms);

Here we are getting all the terms, including empty ones, sorted by the default of names from the taxonomy project