Adding new terms to custom taxonomy
after_setup_theme fires before init, so in this case the code is trying to insert a term into your taxonomy before WordPress is aware that your taxonomy exists! Generally, I feel like init is a better location for both pieces of functionality unless you have a reason to do otherwise. But however you resolve it, if … Read more